diff options
Diffstat (limited to 'libc/syscall')
-rw-r--r-- | libc/syscall/Makefile | 2 | ||||
-rw-r--r-- | libc/syscall/syscall.dat | 4 | ||||
-rw-r--r-- | libc/syscall/syslibc.c | 29 |
3 files changed, 32 insertions, 3 deletions
diff --git a/libc/syscall/Makefile b/libc/syscall/Makefile index 21991ee..fd2f1bc 100644 --- a/libc/syscall/Makefile +++ b/libc/syscall/Makefile @@ -9,7 +9,7 @@ LSRC=syslibc.c LOBJ=__cstartup.o time.o lseek.o getpid.o getppid.o \ getuid.o geteuid.o getgid.o getegid.o \ dup2.o dup.o abort.o wait.o waitpid.o sleep.o \ - killpg.o setpgrp.o getpgrp.o + killpg.o setpgrp.o getpgrp.o times.o usleep.o ESRC=execve.c EOBJ=execve.o execl.o execv.o execle.o diff --git a/libc/syscall/syscall.dat b/libc/syscall/syscall.dat index df61a4f..de5ed9b 100644 --- a/libc/syscall/syscall.dat +++ b/libc/syscall/syscall.dat @@ -67,7 +67,7 @@ RENAME 38 2 MKDIR 39 2 RMDIR 40 1 PIPE 42 1 -TIMES 43 1 +TIMES 43 2 * 2nd arg is pointer for long ret val. SETGID 46 1 GETGID 47 1 * This gets both gid and egid SIGNAL 48 2 * Have put the despatch table in user space. @@ -78,7 +78,7 @@ UMASK 60 1 CHROOT 61 1 USTAT 62 2 GETPGRP 65 0 - use getpgid(0) -SETSID 66 X +SETSID 66 0 SIGACTION 67 X SGETMASK 68 X SSETMASK 69 X diff --git a/libc/syscall/syslibc.c b/libc/syscall/syslibc.c index 1dcb013..e6d58eb 100644 --- a/libc/syscall/syslibc.c +++ b/libc/syscall/syslibc.c @@ -6,6 +6,7 @@ #include <sys/types.h> #include <errno.h> #include <time.h> +#include <sys/times.h> /* MSDOS has it's own versions */ #ifndef __MSDOS__ @@ -117,6 +118,18 @@ time_t *where; } #endif +/********************** Function times ************************************/ + +#ifdef L_times +clock_t times(buf) +struct tms* buf; +{ + long rv; + __times(buf, &rv); + return rv; +} +#endif + /********************** Function lseek ************************************/ #ifdef L_lseek @@ -359,6 +372,22 @@ unsigned int seconds; return seconds - (time((void*)0) - start); } #endif + +#endif + +/********************** Function usleep ************************************/ + +#ifdef L_usleep +#include <sys/time.h> +void +usleep(useconds) +unsigned long useconds; +{ + struct timeval timeout; + timeout.tv_sec = useconds%1000000L; + timeout.tv_usec = useconds/1000000L; + select(1, NULL, NULL, NULL, &timeout); +} #endif /********************** THE END ********************************************/ |