diff --git a/src/lib9/_p9proc-Linux.c b/src/lib9/_p9proc-Linux.c deleted file mode 100644 index 902a9579..00000000 --- a/src/lib9/_p9proc-Linux.c +++ /dev/null @@ -1,5 +0,0 @@ -#ifdef __Linux26__ -#include "_p9proc-pthread.c" -#else -#include "_p9proc-getpid.c" -#endif diff --git a/src/lib9/_p9proc-getpid.c b/src/lib9/_p9proc-getpid.c deleted file mode 100644 index 9543bf24..00000000 --- a/src/lib9/_p9proc-getpid.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - * This needs to be callable from a signal handler, so it has been - * written to avoid locks. The only lock is the one used to acquire - * an entry in the table, and we make sure that acquiring is done - * when not in a handler. Lookup and delete do not need locks. - * It's a scan-forward hash table. To avoid breaking chains, - * T ((void*)-1) is used as a non-breaking nil. - */ - -#include -#include -#include "9proc.h" - -enum { PIDHASH = 1021 }; - -#define T ((void*)-1) -static Uproc *alluproc[PIDHASH]; -static int allupid[PIDHASH]; -static Lock uproclock; - -void -_clearuproc(void) -{ - int i; - - /* called right after fork - no locking needed */ - for(i=0; ipid = pid; - lock(&uproclock); - h = pid%PIDHASH; - for(i=0; i -#include -#include "9proc.h" - -enum { PIDHASH = 1021 }; - -#define T ((void*)-1) -static Uproc *alluproc[PIDHASH]; -static int allupid[PIDHASH]; -static Lock uproclock; - -void -_clearuproc(void) -{ - int i; - - /* called right after fork - no locking needed */ - for(i=0; ipid = pid; - lock(&uproclock); - h = pid%PIDHASH; - for(i=0; i +#include + +int +execl(char *prog, ...) +{ + int i; + va_list arg; + char **argv; + + va_start(arg, prog); + for(i=0; va_arg(arg, char*) != nil; i++) + ; + va_end(arg); + + argv = malloc((i+1)*sizeof(char*)); + if(argv == nil) + return -1; + + va_start(arg, prog); + for(i=0; (argv[i] = va_arg(arg, char*)) != nil; i++) + ; + va_end(arg); + + exec(prog, argv); + free(argv); + return -1; +} +