summaryrefslogtreecommitdiff
path: root/libc/syscall
diff options
context:
space:
mode:
authorRobert de Bath <rdebath@poboxes.com>1996-09-03 22:06:58 +0200
committerLubomir Rintel <lkundrak@v3.sk>2013-10-23 23:31:01 +0200
commit0936b9aeab611665645a4e6bafaded7ca76dd189 (patch)
treefe6384035e96adc260f621d27909be67ad2e724a /libc/syscall
parente85ee07172eccafd9441362e774f7b184810d008 (diff)
downloaddev86-0936b9aeab611665645a4e6bafaded7ca76dd189.tar.gz
Import Dev86-0.0.7.tar.gzv0.0.7
Diffstat (limited to 'libc/syscall')
-rw-r--r--libc/syscall/Makefile2
-rw-r--r--libc/syscall/syscall.dat4
-rw-r--r--libc/syscall/syslibc.c29
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 ********************************************/