revert between 56095 -> 55830 in arch
[AROS.git] / workbench / network / stacks / AROSTCP / libkvm / kvm.c
blob36a8f52dd014e7e94f70d0956aafbd7955a1ec87
1 #include <amitcp/socketbasetags.h>
2 #include <utility/hooks.h>
3 #include <sys/socket.h>
4 #include <netinet/in.h>
5 #include <fcntl.h>
6 #include <kvm.h>
7 #include <netdb.h>
9 #include <proto/socket.h>
10 #define SYSTEM_PRIVATE
11 #include <proto/miami.h>
13 #include <version.h>
15 ULONG __kvm_errno = NULL;
17 kvm_t *kvm_openfiles(const char *execfile, const char *corefile, const char *swapfile, int flags, char *errstr)
19 STRPTR StackVer = "";
20 /* We have only one core and kernel (currently running) */
21 if (execfile || corefile) {
22 strcpy (errstr, "Operation not supported");
23 return NULL;
25 SocketBaseTags(SBTM_GETREF(SBTC_RELEASESTRPTR), (ULONG)&StackVer, TAG_DONE);
26 if (strcmp(StackVer,STACK_RELEASE)) {
27 strcpy (errstr, "Wrong bsdsocket.library version");
28 return NULL;
30 return (kvm_t *)(flags|0xdead0000); /* A clever trick */
33 int kvm_close(kvm_t *kd)
35 return 0;
38 int kvm_nlist (kvm_t *kd, struct nlist *nl)
40 int inval = 0;
42 for (; nl->n_name && nl->n_name[0]; nl++) {
43 nl->n_value = (unsigned long)FindKernelVar (nl->n_name);
44 if (nl->n_value)
45 nl->n_type = N_TEXT;
46 else {
47 nl->n_type = 0;
48 inval++;
50 nl->n_other = 0;
51 nl->n_desc = 0;
53 return inval;