Initial revision
authorceriel <none@none>
Mon, 23 Feb 1987 18:58:58 +0000 (18:58 +0000)
committerceriel <none@none>
Mon, 23 Feb 1987 18:58:58 +0000 (18:58 +0000)
132 files changed:
mach/vax4/libbsd4_2/LIST [new file with mode: 0644]
mach/vax4/libbsd4_2/_exit.s [new file with mode: 0644]
mach/vax4/libbsd4_2/accept.s [new file with mode: 0644]
mach/vax4/libbsd4_2/access.s [new file with mode: 0644]
mach/vax4/libbsd4_2/acct.s [new file with mode: 0644]
mach/vax4/libbsd4_2/alarm.c [new file with mode: 0644]
mach/vax4/libbsd4_2/bind.s [new file with mode: 0644]
mach/vax4/libbsd4_2/brk.s [new file with mode: 0644]
mach/vax4/libbsd4_2/cerror.s [new file with mode: 0644]
mach/vax4/libbsd4_2/chdir.s [new file with mode: 0644]
mach/vax4/libbsd4_2/chmod.s [new file with mode: 0644]
mach/vax4/libbsd4_2/chown.s [new file with mode: 0644]
mach/vax4/libbsd4_2/chroot.s [new file with mode: 0644]
mach/vax4/libbsd4_2/cleanup.c [new file with mode: 0644]
mach/vax4/libbsd4_2/close.s [new file with mode: 0644]
mach/vax4/libbsd4_2/connect.s [new file with mode: 0644]
mach/vax4/libbsd4_2/creat.s [new file with mode: 0644]
mach/vax4/libbsd4_2/dup.s [new file with mode: 0644]
mach/vax4/libbsd4_2/dup2.s [new file with mode: 0644]
mach/vax4/libbsd4_2/execl.s [new file with mode: 0644]
mach/vax4/libbsd4_2/execle.s [new file with mode: 0644]
mach/vax4/libbsd4_2/exect.s [new file with mode: 0644]
mach/vax4/libbsd4_2/execv.s [new file with mode: 0644]
mach/vax4/libbsd4_2/execve.s [new file with mode: 0644]
mach/vax4/libbsd4_2/exit.c [new file with mode: 0644]
mach/vax4/libbsd4_2/fchmod.s [new file with mode: 0644]
mach/vax4/libbsd4_2/fchown.s [new file with mode: 0644]
mach/vax4/libbsd4_2/fcntl.s [new file with mode: 0644]
mach/vax4/libbsd4_2/flock.s [new file with mode: 0644]
mach/vax4/libbsd4_2/fork.s [new file with mode: 0644]
mach/vax4/libbsd4_2/fstat.s [new file with mode: 0644]
mach/vax4/libbsd4_2/fsync.s [new file with mode: 0644]
mach/vax4/libbsd4_2/ftime.c [new file with mode: 0644]
mach/vax4/libbsd4_2/ftruncate.s [new file with mode: 0644]
mach/vax4/libbsd4_2/getdtabsz.s [new file with mode: 0644]
mach/vax4/libbsd4_2/getegid.s [new file with mode: 0644]
mach/vax4/libbsd4_2/geteuid.s [new file with mode: 0644]
mach/vax4/libbsd4_2/getgid.s [new file with mode: 0644]
mach/vax4/libbsd4_2/getgroups.s [new file with mode: 0644]
mach/vax4/libbsd4_2/gethostid.s [new file with mode: 0644]
mach/vax4/libbsd4_2/gethostnam.s [new file with mode: 0644]
mach/vax4/libbsd4_2/getitimer.s [new file with mode: 0644]
mach/vax4/libbsd4_2/getpagesiz.s [new file with mode: 0644]
mach/vax4/libbsd4_2/getpeernam.s [new file with mode: 0644]
mach/vax4/libbsd4_2/getpgrp.s [new file with mode: 0644]
mach/vax4/libbsd4_2/getpid.s [new file with mode: 0644]
mach/vax4/libbsd4_2/getppid.s [new file with mode: 0644]
mach/vax4/libbsd4_2/getprio.s [new file with mode: 0644]
mach/vax4/libbsd4_2/getrlimit.s [new file with mode: 0644]
mach/vax4/libbsd4_2/getrusage.s [new file with mode: 0644]
mach/vax4/libbsd4_2/getsocknam.s [new file with mode: 0644]
mach/vax4/libbsd4_2/getsockopt.s [new file with mode: 0644]
mach/vax4/libbsd4_2/gettimday.s [new file with mode: 0644]
mach/vax4/libbsd4_2/getuid.s [new file with mode: 0644]
mach/vax4/libbsd4_2/gtty.c [new file with mode: 0644]
mach/vax4/libbsd4_2/ioctl.s [new file with mode: 0644]
mach/vax4/libbsd4_2/kill.s [new file with mode: 0644]
mach/vax4/libbsd4_2/killpg.s [new file with mode: 0644]
mach/vax4/libbsd4_2/link.s [new file with mode: 0644]
mach/vax4/libbsd4_2/listen.s [new file with mode: 0644]
mach/vax4/libbsd4_2/lseek.s [new file with mode: 0644]
mach/vax4/libbsd4_2/lstat.s [new file with mode: 0644]
mach/vax4/libbsd4_2/mkdir.s [new file with mode: 0644]
mach/vax4/libbsd4_2/mknod.s [new file with mode: 0644]
mach/vax4/libbsd4_2/mount.s [new file with mode: 0644]
mach/vax4/libbsd4_2/nice.c [new file with mode: 0644]
mach/vax4/libbsd4_2/open.s [new file with mode: 0644]
mach/vax4/libbsd4_2/pause.c [new file with mode: 0644]
mach/vax4/libbsd4_2/pipe.s [new file with mode: 0644]
mach/vax4/libbsd4_2/profil.s [new file with mode: 0644]
mach/vax4/libbsd4_2/ptrace.s [new file with mode: 0644]
mach/vax4/libbsd4_2/quota.s [new file with mode: 0644]
mach/vax4/libbsd4_2/read.s [new file with mode: 0644]
mach/vax4/libbsd4_2/readlink.s [new file with mode: 0644]
mach/vax4/libbsd4_2/readv.s [new file with mode: 0644]
mach/vax4/libbsd4_2/reboot.s [new file with mode: 0644]
mach/vax4/libbsd4_2/recv.s [new file with mode: 0644]
mach/vax4/libbsd4_2/recvfrom.s [new file with mode: 0644]
mach/vax4/libbsd4_2/recvmsg.s [new file with mode: 0644]
mach/vax4/libbsd4_2/rename.s [new file with mode: 0644]
mach/vax4/libbsd4_2/rmdir.s [new file with mode: 0644]
mach/vax4/libbsd4_2/select.s [new file with mode: 0644]
mach/vax4/libbsd4_2/send.s [new file with mode: 0644]
mach/vax4/libbsd4_2/sendmsg.s [new file with mode: 0644]
mach/vax4/libbsd4_2/sendto.s [new file with mode: 0644]
mach/vax4/libbsd4_2/setgid.c [new file with mode: 0644]
mach/vax4/libbsd4_2/setgroups.s [new file with mode: 0644]
mach/vax4/libbsd4_2/sethostid.s [new file with mode: 0644]
mach/vax4/libbsd4_2/sethostnam.s [new file with mode: 0644]
mach/vax4/libbsd4_2/setitimer.s [new file with mode: 0644]
mach/vax4/libbsd4_2/setpgrp.s [new file with mode: 0644]
mach/vax4/libbsd4_2/setprio.s [new file with mode: 0644]
mach/vax4/libbsd4_2/setquota.s [new file with mode: 0644]
mach/vax4/libbsd4_2/setregid.s [new file with mode: 0644]
mach/vax4/libbsd4_2/setreuid.s [new file with mode: 0644]
mach/vax4/libbsd4_2/setrlimit.s [new file with mode: 0644]
mach/vax4/libbsd4_2/setsockopt.s [new file with mode: 0644]
mach/vax4/libbsd4_2/settimday.s [new file with mode: 0644]
mach/vax4/libbsd4_2/setuid.c [new file with mode: 0644]
mach/vax4/libbsd4_2/shutdown.s [new file with mode: 0644]
mach/vax4/libbsd4_2/sigblock.s [new file with mode: 0644]
mach/vax4/libbsd4_2/signal.c [new file with mode: 0644]
mach/vax4/libbsd4_2/sigpause.s [new file with mode: 0644]
mach/vax4/libbsd4_2/sigsetmask.s [new file with mode: 0644]
mach/vax4/libbsd4_2/sigstack.s [new file with mode: 0644]
mach/vax4/libbsd4_2/sigvec.s [new file with mode: 0644]
mach/vax4/libbsd4_2/socket.s [new file with mode: 0644]
mach/vax4/libbsd4_2/socketpair.s [new file with mode: 0644]
mach/vax4/libbsd4_2/stat.s [new file with mode: 0644]
mach/vax4/libbsd4_2/stime.c [new file with mode: 0644]
mach/vax4/libbsd4_2/stty.c [new file with mode: 0644]
mach/vax4/libbsd4_2/swapon.s [new file with mode: 0644]
mach/vax4/libbsd4_2/symlink.s [new file with mode: 0644]
mach/vax4/libbsd4_2/sync.s [new file with mode: 0644]
mach/vax4/libbsd4_2/syscall.h [new file with mode: 0644]
mach/vax4/libbsd4_2/syscall.s [new file with mode: 0644]
mach/vax4/libbsd4_2/tell.c [new file with mode: 0644]
mach/vax4/libbsd4_2/time.c [new file with mode: 0644]
mach/vax4/libbsd4_2/times.c [new file with mode: 0644]
mach/vax4/libbsd4_2/truncate.s [new file with mode: 0644]
mach/vax4/libbsd4_2/umask.s [new file with mode: 0644]
mach/vax4/libbsd4_2/umount.s [new file with mode: 0644]
mach/vax4/libbsd4_2/unlink.s [new file with mode: 0644]
mach/vax4/libbsd4_2/utime.c [new file with mode: 0644]
mach/vax4/libbsd4_2/utimes.s [new file with mode: 0644]
mach/vax4/libbsd4_2/vadvise.s [new file with mode: 0644]
mach/vax4/libbsd4_2/vfork.s [new file with mode: 0644]
mach/vax4/libbsd4_2/vhangup.s [new file with mode: 0644]
mach/vax4/libbsd4_2/wait.s [new file with mode: 0644]
mach/vax4/libbsd4_2/wait3.s [new file with mode: 0644]
mach/vax4/libbsd4_2/write.s [new file with mode: 0644]
mach/vax4/libbsd4_2/writev.s [new file with mode: 0644]

diff --git a/mach/vax4/libbsd4_2/LIST b/mach/vax4/libbsd4_2/LIST
new file mode 100644 (file)
index 0000000..8ea4f33
--- /dev/null
@@ -0,0 +1,131 @@
+libmon_s.a
+accept.s
+access.s
+acct.s
+alarm.c
+bind.s
+brk.s
+cerror.s
+chdir.s
+chmod.s
+chown.s
+chroot.s
+close.s
+connect.s
+creat.s
+dup.s
+dup2.s
+execl.s
+execle.s
+exect.s
+execv.s
+execve.s
+exit.c
+_exit.s
+cleanup.c
+fchmod.s
+fchown.s
+fcntl.s
+flock.s
+fork.s
+fstat.s
+fsync.s
+ftime.c
+ftruncate.s
+getdtabsz.s
+getegid.s
+geteuid.s
+getgid.s
+getgroups.s
+gethostid.s
+gethostnam.s
+getitimer.s
+getpagesiz.s
+getpeernam.s
+getpgrp.s
+getpid.s
+getppid.s
+getrlimit.s
+getsocknam.s
+getsockopt.s
+getuid.s
+gtty.c
+kill.s
+killpg.s
+link.s
+listen.s
+lstat.s
+mkdir.s
+mknod.s
+mount.s
+nice.c
+getprio.s
+open.s
+pause.c
+pipe.s
+profil.s
+ptrace.s
+quota.s
+read.s
+readlink.s
+readv.s
+reboot.s
+recv.s
+recvfrom.s
+recvmsg.s
+rename.s
+rmdir.s
+select.s
+send.s
+sendmsg.s
+sendto.s
+setgid.c
+setgroups.s
+sethostid.s
+sethostnam.s
+setitimer.s
+setpgrp.s
+setprio.s
+setquota.s
+setregid.s
+setrlimit.s
+setsockopt.s
+setuid.c
+setreuid.s
+shutdown.s
+sigblock.s
+signal.c
+sigpause.s
+sigsetmask.s
+sigstack.s
+sigvec.s
+socket.s
+socketpair.s
+stat.s
+stime.c
+settimday.s
+stty.c
+ioctl.s
+swapon.s
+symlink.s
+sync.s
+syscall.s
+tell.c
+lseek.s
+time.c
+gettimday.s
+times.c
+getrusage.s
+truncate.s
+umask.s
+umount.s
+unlink.s
+utime.c
+utimes.s
+vadvise.s
+vfork.s
+vhangup.s
+wait.s
+wait3.s
+write.s
+writev.s
diff --git a/mach/vax4/libbsd4_2/_exit.s b/mach/vax4/libbsd4_2/_exit.s
new file mode 100644 (file)
index 0000000..eb7e0ae
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(__exit)
+SYSTEM(SYS_exit)
diff --git a/mach/vax4/libbsd4_2/accept.s b/mach/vax4/libbsd4_2/accept.s
new file mode 100644 (file)
index 0000000..babb7a4
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_accept)
+SYSTEM(SYS_accept)
diff --git a/mach/vax4/libbsd4_2/access.s b/mach/vax4/libbsd4_2/access.s
new file mode 100644 (file)
index 0000000..43f2d75
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_access)
+SYSTEM(SYS_access)
diff --git a/mach/vax4/libbsd4_2/acct.s b/mach/vax4/libbsd4_2/acct.s
new file mode 100644 (file)
index 0000000..7552ca7
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_acct)
+SYSTEM(SYS_acct)
diff --git a/mach/vax4/libbsd4_2/alarm.c b/mach/vax4/libbsd4_2/alarm.c
new file mode 100644 (file)
index 0000000..ddbf244
--- /dev/null
@@ -0,0 +1,13 @@
+unsigned
+alarm(n)
+       unsigned n;
+{
+       struct { long l1,l2,l3,l4; } t1,t2;
+       t1.l1 = 0;
+       t1.l2 = 0;
+       t1.l4 = 0;
+       t1.l3 = n;
+       if (setitimer(0,&t1,&t2) < 0) return -1;
+       if (t2.l4) t2.l3++;
+       return t2.l3;
+}
diff --git a/mach/vax4/libbsd4_2/bind.s b/mach/vax4/libbsd4_2/bind.s
new file mode 100644 (file)
index 0000000..f0aa674
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_bind)
+SYSTEM(SYS_bind)
diff --git a/mach/vax4/libbsd4_2/brk.s b/mach/vax4/libbsd4_2/brk.s
new file mode 100644 (file)
index 0000000..22020bc
--- /dev/null
@@ -0,0 +1,29 @@
+#include "syscall.h"
+.globl _end
+DEFINE(_brk)
+       cmpl    4(ap),min
+       bgeq    ok
+       movl    min,4(ap)
+ok:
+       chmk    $17
+       bcs     err
+       movl    4(ap),cur
+       clrl    r0
+       ret
+err:
+       jmp     cerror
+
+DEFINE(_sbrk)
+       addl3   cur,4(ap),-(sp)
+       bcs     err
+       pushl   $1
+       movl    ap,r3
+       movl    sp,ap
+       chmk    $17
+       bcs     err
+       movl    cur,r0
+       addl2   4(r3),cur
+       ret
+.data
+min: .long     _end
+cur: .long     _end
diff --git a/mach/vax4/libbsd4_2/cerror.s b/mach/vax4/libbsd4_2/cerror.s
new file mode 100644 (file)
index 0000000..cbd332a
--- /dev/null
@@ -0,0 +1,5 @@
+       .globl  _errno
+cerror:
+       movl    r0,_errno
+       mnegl   $1,r0
+       ret
diff --git a/mach/vax4/libbsd4_2/chdir.s b/mach/vax4/libbsd4_2/chdir.s
new file mode 100644 (file)
index 0000000..6d424af
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_chdir)
+SYSTEM(SYS_chdir)
diff --git a/mach/vax4/libbsd4_2/chmod.s b/mach/vax4/libbsd4_2/chmod.s
new file mode 100644 (file)
index 0000000..a03aec0
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_chmod)
+SYSTEM(SYS_chmod)
diff --git a/mach/vax4/libbsd4_2/chown.s b/mach/vax4/libbsd4_2/chown.s
new file mode 100644 (file)
index 0000000..f1d1c47
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_chwon)
+SYSTEM(SYS_chwon)
diff --git a/mach/vax4/libbsd4_2/chroot.s b/mach/vax4/libbsd4_2/chroot.s
new file mode 100644 (file)
index 0000000..7d910a9
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_chroot)
+SYSTEM(SYS_chroot)
diff --git a/mach/vax4/libbsd4_2/cleanup.c b/mach/vax4/libbsd4_2/cleanup.c
new file mode 100644 (file)
index 0000000..6cd9c63
--- /dev/null
@@ -0,0 +1 @@
+_cleanup() { }
diff --git a/mach/vax4/libbsd4_2/close.s b/mach/vax4/libbsd4_2/close.s
new file mode 100644 (file)
index 0000000..0226d29
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_close)
+SYSTEM(SYS_close)
diff --git a/mach/vax4/libbsd4_2/connect.s b/mach/vax4/libbsd4_2/connect.s
new file mode 100644 (file)
index 0000000..2ec2c5a
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_connect)
+SYSTEM(SYS_connect)
diff --git a/mach/vax4/libbsd4_2/creat.s b/mach/vax4/libbsd4_2/creat.s
new file mode 100644 (file)
index 0000000..f34f949
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_creat)
+SYSTEM(SYS_creat)
diff --git a/mach/vax4/libbsd4_2/dup.s b/mach/vax4/libbsd4_2/dup.s
new file mode 100644 (file)
index 0000000..727018d
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_dup)
+SYSTEM(SYS_dup)
diff --git a/mach/vax4/libbsd4_2/dup2.s b/mach/vax4/libbsd4_2/dup2.s
new file mode 100644 (file)
index 0000000..95f3c72
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_dup2)
+SYSTEM(SYS_dup2)
diff --git a/mach/vax4/libbsd4_2/execl.s b/mach/vax4/libbsd4_2/execl.s
new file mode 100644 (file)
index 0000000..5bc463c
--- /dev/null
@@ -0,0 +1,8 @@
+#include "syscall.h"
+.globl _environ
+DEFINE(_execl)
+       pushl   _environ
+       pushab  8(ap)
+       pushl   4(ap)
+       calls   $3,_execve
+       ret
diff --git a/mach/vax4/libbsd4_2/execle.s b/mach/vax4/libbsd4_2/execle.s
new file mode 100644 (file)
index 0000000..5a8c907
--- /dev/null
@@ -0,0 +1,8 @@
+#include "syscall.h"
+DEFINE(_execle)
+       movl    (ap),r0
+       pushl   (ap)[r0]
+       pushab  8(ap)
+       pushl   4(ap)
+       calls   $3,_execve
+       ret
diff --git a/mach/vax4/libbsd4_2/exect.s b/mach/vax4/libbsd4_2/exect.s
new file mode 100644 (file)
index 0000000..dbcea6c
--- /dev/null
@@ -0,0 +1,5 @@
+#include "syscall.h"
+DEFINE(_exect)
+       bispsw  $16
+       chmk    $SYS_execve
+       jmp     cerror
diff --git a/mach/vax4/libbsd4_2/execv.s b/mach/vax4/libbsd4_2/execv.s
new file mode 100644 (file)
index 0000000..d40da80
--- /dev/null
@@ -0,0 +1,8 @@
+#include "syscall.h"
+.globl _environ
+DEFINE(_execv)
+       pushl   _environ
+       pushl   8(ap)
+       pushl   4(ap)
+       calls   $3,_execve
+       ret
diff --git a/mach/vax4/libbsd4_2/execve.s b/mach/vax4/libbsd4_2/execve.s
new file mode 100644 (file)
index 0000000..c962d57
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_execve)
+SYSTEM(SYS_execve)
diff --git a/mach/vax4/libbsd4_2/exit.c b/mach/vax4/libbsd4_2/exit.c
new file mode 100644 (file)
index 0000000..afd54b3
--- /dev/null
@@ -0,0 +1,5 @@
+exit(n)
+{
+       _cleanup();
+       _exit(n);
+}
diff --git a/mach/vax4/libbsd4_2/fchmod.s b/mach/vax4/libbsd4_2/fchmod.s
new file mode 100644 (file)
index 0000000..313c87f
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_fchmod)
+SYSTEM(SYS_fchmod)
diff --git a/mach/vax4/libbsd4_2/fchown.s b/mach/vax4/libbsd4_2/fchown.s
new file mode 100644 (file)
index 0000000..c027655
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_fchown)
+SYSTEM(SYS_fchown)
diff --git a/mach/vax4/libbsd4_2/fcntl.s b/mach/vax4/libbsd4_2/fcntl.s
new file mode 100644 (file)
index 0000000..7e6e35c
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_fcntl)
+SYSTEM(SYS_fcntl)
diff --git a/mach/vax4/libbsd4_2/flock.s b/mach/vax4/libbsd4_2/flock.s
new file mode 100644 (file)
index 0000000..e4567ee
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_flock)
+SYSTEM(SYS_flock)
diff --git a/mach/vax4/libbsd4_2/fork.s b/mach/vax4/libbsd4_2/fork.s
new file mode 100644 (file)
index 0000000..548ccc0
--- /dev/null
@@ -0,0 +1,10 @@
+#include "syscall.h"
+DEFINE(_fork)
+       chmk    $SYS_fork
+       bcs     err
+       jlbc    r1,parent
+       clrl    r0
+parent:
+       ret
+err:
+       jmp     cerror
diff --git a/mach/vax4/libbsd4_2/fstat.s b/mach/vax4/libbsd4_2/fstat.s
new file mode 100644 (file)
index 0000000..54b5d29
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_fstat)
+SYSTEM(SYS_fstat)
diff --git a/mach/vax4/libbsd4_2/fsync.s b/mach/vax4/libbsd4_2/fsync.s
new file mode 100644 (file)
index 0000000..54d15b3
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_fsync)
+SYSTEM(SYS_fsync)
diff --git a/mach/vax4/libbsd4_2/ftime.c b/mach/vax4/libbsd4_2/ftime.c
new file mode 100644 (file)
index 0000000..af4047c
--- /dev/null
@@ -0,0 +1,15 @@
+#include <sys/types.h>
+
+ftime(p)
+       struct { time_t time; unsigned short millitm;
+                short timezone; short dstflag; } *p;
+{
+       struct { long l1,l2; } t1,t2;
+
+       if (gettimeofday(&t1,&t2) < 0) return -1;
+       p->time = t1.l1;
+       p->millitm = t1.l2/1000;
+       p->dstflag = t2.l2;
+       p->timezone = t2.l1;
+       return 0;
+}
diff --git a/mach/vax4/libbsd4_2/ftruncate.s b/mach/vax4/libbsd4_2/ftruncate.s
new file mode 100644 (file)
index 0000000..eadfb12
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_ftruncate)
+SYSTEM(SYS_ftruncate)
diff --git a/mach/vax4/libbsd4_2/getdtabsz.s b/mach/vax4/libbsd4_2/getdtabsz.s
new file mode 100644 (file)
index 0000000..02c7ae8
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_getdtablesize)
+SYSTEM(SYS_getdtablesize)
diff --git a/mach/vax4/libbsd4_2/getegid.s b/mach/vax4/libbsd4_2/getegid.s
new file mode 100644 (file)
index 0000000..e34d623
--- /dev/null
@@ -0,0 +1,5 @@
+#include "syscall.h"
+DEFINE(_getegid)
+SYSNORET(SYS_getgid)
+       movl    r1,r0
+       ret
diff --git a/mach/vax4/libbsd4_2/geteuid.s b/mach/vax4/libbsd4_2/geteuid.s
new file mode 100644 (file)
index 0000000..39b7775
--- /dev/null
@@ -0,0 +1,5 @@
+#include "syscall.h"
+DEFINE(_geteuid)
+SYSNORET(SYS_getuid)
+       movl    r1,r0
+       ret
diff --git a/mach/vax4/libbsd4_2/getgid.s b/mach/vax4/libbsd4_2/getgid.s
new file mode 100644 (file)
index 0000000..ba6c334
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_getgid)
+SYSTEM(SYS_getgid)
diff --git a/mach/vax4/libbsd4_2/getgroups.s b/mach/vax4/libbsd4_2/getgroups.s
new file mode 100644 (file)
index 0000000..a7ab0ef
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_getgroups)
+SYSTEM(SYS_getgroups)
diff --git a/mach/vax4/libbsd4_2/gethostid.s b/mach/vax4/libbsd4_2/gethostid.s
new file mode 100644 (file)
index 0000000..7d3aaf0
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_gethostid)
+SYSTEM(SYS_gethostid)
diff --git a/mach/vax4/libbsd4_2/gethostnam.s b/mach/vax4/libbsd4_2/gethostnam.s
new file mode 100644 (file)
index 0000000..2b6c951
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_gethostname)
+SYSTEM(SYS_gethostname)
diff --git a/mach/vax4/libbsd4_2/getitimer.s b/mach/vax4/libbsd4_2/getitimer.s
new file mode 100644 (file)
index 0000000..81d850c
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_getitimer)
+SYSTEM(SYS_getitimer)
diff --git a/mach/vax4/libbsd4_2/getpagesiz.s b/mach/vax4/libbsd4_2/getpagesiz.s
new file mode 100644 (file)
index 0000000..e8a4892
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_getpagesize)
+SYSTEM(SYS_getpagesize)
diff --git a/mach/vax4/libbsd4_2/getpeernam.s b/mach/vax4/libbsd4_2/getpeernam.s
new file mode 100644 (file)
index 0000000..d0e53e5
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_getpeername)
+SYSTEM(SYS_getpeername)
diff --git a/mach/vax4/libbsd4_2/getpgrp.s b/mach/vax4/libbsd4_2/getpgrp.s
new file mode 100644 (file)
index 0000000..c19d1b1
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_getpgrp)
+SYSTEM(SYS_getpgrp)
diff --git a/mach/vax4/libbsd4_2/getpid.s b/mach/vax4/libbsd4_2/getpid.s
new file mode 100644 (file)
index 0000000..6d07fe6
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_getpid)
+SYSTEM(SYS_getpid)
diff --git a/mach/vax4/libbsd4_2/getppid.s b/mach/vax4/libbsd4_2/getppid.s
new file mode 100644 (file)
index 0000000..2742de1
--- /dev/null
@@ -0,0 +1,5 @@
+#include "syscall.h"
+DEFINE(_getppid)
+SYSNORET(SYS_getpid)
+       movl    r1,r0
+       ret
diff --git a/mach/vax4/libbsd4_2/getprio.s b/mach/vax4/libbsd4_2/getprio.s
new file mode 100644 (file)
index 0000000..34d7ad2
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_getpriority)
+SYSTEM(SYS_getpriority)
diff --git a/mach/vax4/libbsd4_2/getrlimit.s b/mach/vax4/libbsd4_2/getrlimit.s
new file mode 100644 (file)
index 0000000..8b2b098
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_getrlimit)
+SYSTEM(SYS_getrlimit)
diff --git a/mach/vax4/libbsd4_2/getrusage.s b/mach/vax4/libbsd4_2/getrusage.s
new file mode 100644 (file)
index 0000000..a30bcde
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_getrusage)
+SYSTEM(SYS_getrusage)
diff --git a/mach/vax4/libbsd4_2/getsocknam.s b/mach/vax4/libbsd4_2/getsocknam.s
new file mode 100644 (file)
index 0000000..889439b
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_getsockname)
+SYSTEM(SYS_getsockname)
diff --git a/mach/vax4/libbsd4_2/getsockopt.s b/mach/vax4/libbsd4_2/getsockopt.s
new file mode 100644 (file)
index 0000000..34143d5
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_getsockopt)
+SYSTEM(SYS_getsockopt)
diff --git a/mach/vax4/libbsd4_2/gettimday.s b/mach/vax4/libbsd4_2/gettimday.s
new file mode 100644 (file)
index 0000000..7a52847
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_gettimeofday)
+SYSTEM(SYS_gettimeofday)
diff --git a/mach/vax4/libbsd4_2/getuid.s b/mach/vax4/libbsd4_2/getuid.s
new file mode 100644 (file)
index 0000000..c32ef03
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_getuid)
+SYSTEM(SYS_getuid)
diff --git a/mach/vax4/libbsd4_2/gtty.c b/mach/vax4/libbsd4_2/gtty.c
new file mode 100644 (file)
index 0000000..7f42ea1
--- /dev/null
@@ -0,0 +1,7 @@
+#include <sgtty.h>
+int gtty(fildes,argp)
+       int fildes ;
+       struct sgttyb *argp ;
+{
+       return ioctl(fildes,TIOCGETP,argp) ;
+}
diff --git a/mach/vax4/libbsd4_2/ioctl.s b/mach/vax4/libbsd4_2/ioctl.s
new file mode 100644 (file)
index 0000000..bcb7910
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_ioctl)
+SYSTEM(SYS_ioctl)
diff --git a/mach/vax4/libbsd4_2/kill.s b/mach/vax4/libbsd4_2/kill.s
new file mode 100644 (file)
index 0000000..abecfbc
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_kill)
+SYSTEM(SYS_kill)
diff --git a/mach/vax4/libbsd4_2/killpg.s b/mach/vax4/libbsd4_2/killpg.s
new file mode 100644 (file)
index 0000000..e6f362c
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_killpg)
+SYSTEM(SYS_killpg)
diff --git a/mach/vax4/libbsd4_2/link.s b/mach/vax4/libbsd4_2/link.s
new file mode 100644 (file)
index 0000000..26ecc04
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_link)
+SYSTEM(SYS_link)
diff --git a/mach/vax4/libbsd4_2/listen.s b/mach/vax4/libbsd4_2/listen.s
new file mode 100644 (file)
index 0000000..d932140
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_listen)
+SYSTEM(SYS_listen)
diff --git a/mach/vax4/libbsd4_2/lseek.s b/mach/vax4/libbsd4_2/lseek.s
new file mode 100644 (file)
index 0000000..608e116
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_lseek)
+SYSTEM(SYS_lseek)
diff --git a/mach/vax4/libbsd4_2/lstat.s b/mach/vax4/libbsd4_2/lstat.s
new file mode 100644 (file)
index 0000000..7bf45ee
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_lstat)
+SYSTEM(SYS_lstat)
diff --git a/mach/vax4/libbsd4_2/mkdir.s b/mach/vax4/libbsd4_2/mkdir.s
new file mode 100644 (file)
index 0000000..a297b48
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_mkdir)
+SYSTEM(SYS_mkdir)
diff --git a/mach/vax4/libbsd4_2/mknod.s b/mach/vax4/libbsd4_2/mknod.s
new file mode 100644 (file)
index 0000000..9dbaf7e
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_mknod)
+SYSTEM(SYS_mknod)
diff --git a/mach/vax4/libbsd4_2/mount.s b/mach/vax4/libbsd4_2/mount.s
new file mode 100644 (file)
index 0000000..619259c
--- /dev/null
@@ -0,0 +1,5 @@
+#include "syscall.h"
+DEFINE(_mount)
+SYSNORET(SYS_mount)
+       clrl    r0
+       ret
diff --git a/mach/vax4/libbsd4_2/nice.c b/mach/vax4/libbsd4_2/nice.c
new file mode 100644 (file)
index 0000000..2350566
--- /dev/null
@@ -0,0 +1,13 @@
+nice(incr)
+{
+       extern int errno;
+       int sav = errno;
+       int prio;
+
+       errno = 0;
+       prio = getpriority(0,0);
+       if (prio == -1 && errno) return -1;
+       if (setpriority(0,0,prio+incr) < 0) return -1;
+       errno = sav;
+       return 0;
+}
diff --git a/mach/vax4/libbsd4_2/open.s b/mach/vax4/libbsd4_2/open.s
new file mode 100644 (file)
index 0000000..edcdb2f
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_open)
+SYSTEM(SYS_open)
diff --git a/mach/vax4/libbsd4_2/pause.c b/mach/vax4/libbsd4_2/pause.c
new file mode 100644 (file)
index 0000000..97c0242
--- /dev/null
@@ -0,0 +1,3 @@
+pause() {
+       sigpause(sigblock());
+}
diff --git a/mach/vax4/libbsd4_2/pipe.s b/mach/vax4/libbsd4_2/pipe.s
new file mode 100644 (file)
index 0000000..27fa9f9
--- /dev/null
@@ -0,0 +1,8 @@
+#include "syscall.h"
+DEFINE(_pipe)
+SYSNORET(SYS_pipe)
+       movl    4(ap),r2
+       movl    r0,(r2)+
+       movl    r1,(r2)
+       clrl    r0
+       ret
diff --git a/mach/vax4/libbsd4_2/profil.s b/mach/vax4/libbsd4_2/profil.s
new file mode 100644 (file)
index 0000000..2e4671e
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_profil)
+SYSTEM(SYS_profil)
diff --git a/mach/vax4/libbsd4_2/ptrace.s b/mach/vax4/libbsd4_2/ptrace.s
new file mode 100644 (file)
index 0000000..511b695
--- /dev/null
@@ -0,0 +1,4 @@
+#include "syscall.h"
+DEFINE(_ptrace)
+       clrl    _errno
+SYSTEM(SYS_ptrace)
diff --git a/mach/vax4/libbsd4_2/quota.s b/mach/vax4/libbsd4_2/quota.s
new file mode 100644 (file)
index 0000000..160b1c4
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_quota)
+SYSTEM(SYS_quota)
diff --git a/mach/vax4/libbsd4_2/read.s b/mach/vax4/libbsd4_2/read.s
new file mode 100644 (file)
index 0000000..abff733
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_read)
+SYSTEM(SYS_read)
diff --git a/mach/vax4/libbsd4_2/readlink.s b/mach/vax4/libbsd4_2/readlink.s
new file mode 100644 (file)
index 0000000..5573bbf
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_readlink)
+SYSTEM(SYS_readlink)
diff --git a/mach/vax4/libbsd4_2/readv.s b/mach/vax4/libbsd4_2/readv.s
new file mode 100644 (file)
index 0000000..969b14f
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_readv)
+SYSTEM(SYS_readv)
diff --git a/mach/vax4/libbsd4_2/reboot.s b/mach/vax4/libbsd4_2/reboot.s
new file mode 100644 (file)
index 0000000..70b690e
--- /dev/null
@@ -0,0 +1,4 @@
+#include "syscall.h"
+DEFINE(_reboot)
+SYSNORET(SYS_reboot)
+       halt
diff --git a/mach/vax4/libbsd4_2/recv.s b/mach/vax4/libbsd4_2/recv.s
new file mode 100644 (file)
index 0000000..f1dc07d
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_recv)
+SYSTEM(SYS_recv)
diff --git a/mach/vax4/libbsd4_2/recvfrom.s b/mach/vax4/libbsd4_2/recvfrom.s
new file mode 100644 (file)
index 0000000..7f2e155
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_recvfrom)
+SYSTEM(SYS_recvfrom)
diff --git a/mach/vax4/libbsd4_2/recvmsg.s b/mach/vax4/libbsd4_2/recvmsg.s
new file mode 100644 (file)
index 0000000..88afc98
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_recvmsg)
+SYSTEM(SYS_recvmsg)
diff --git a/mach/vax4/libbsd4_2/rename.s b/mach/vax4/libbsd4_2/rename.s
new file mode 100644 (file)
index 0000000..a892b06
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_rename)
+SYSTEM(SYS_rename)
diff --git a/mach/vax4/libbsd4_2/rmdir.s b/mach/vax4/libbsd4_2/rmdir.s
new file mode 100644 (file)
index 0000000..35b1296
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_rmdir)
+SYSTEM(SYS_rmdir)
diff --git a/mach/vax4/libbsd4_2/select.s b/mach/vax4/libbsd4_2/select.s
new file mode 100644 (file)
index 0000000..d2da407
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_select)
+SYSTEM(SYS_select)
diff --git a/mach/vax4/libbsd4_2/send.s b/mach/vax4/libbsd4_2/send.s
new file mode 100644 (file)
index 0000000..9c10ce5
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_send)
+SYSTEM(SYS_send)
diff --git a/mach/vax4/libbsd4_2/sendmsg.s b/mach/vax4/libbsd4_2/sendmsg.s
new file mode 100644 (file)
index 0000000..b78abca
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_sendmsg)
+SYSTEM(SYS_sendmsg)
diff --git a/mach/vax4/libbsd4_2/sendto.s b/mach/vax4/libbsd4_2/sendto.s
new file mode 100644 (file)
index 0000000..6d3e710
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_sendto)
+SYSTEM(SYS_sendto)
diff --git a/mach/vax4/libbsd4_2/setgid.c b/mach/vax4/libbsd4_2/setgid.c
new file mode 100644 (file)
index 0000000..c51a4d0
--- /dev/null
@@ -0,0 +1,4 @@
+setgid(u)
+{
+       return setregid(u,u);
+}
diff --git a/mach/vax4/libbsd4_2/setgroups.s b/mach/vax4/libbsd4_2/setgroups.s
new file mode 100644 (file)
index 0000000..c3571c3
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_setgroups)
+SYSTEM(SYS_setgroups)
diff --git a/mach/vax4/libbsd4_2/sethostid.s b/mach/vax4/libbsd4_2/sethostid.s
new file mode 100644 (file)
index 0000000..ffab90d
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_sethostid)
+SYSTEM(SYS_sethostid)
diff --git a/mach/vax4/libbsd4_2/sethostnam.s b/mach/vax4/libbsd4_2/sethostnam.s
new file mode 100644 (file)
index 0000000..7a947e7
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_sethostname)
+SYSTEM(SYS_sethostname)
diff --git a/mach/vax4/libbsd4_2/setitimer.s b/mach/vax4/libbsd4_2/setitimer.s
new file mode 100644 (file)
index 0000000..8b1f18e
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_setitimer)
+SYSTEM(SYS_setitimer)
diff --git a/mach/vax4/libbsd4_2/setpgrp.s b/mach/vax4/libbsd4_2/setpgrp.s
new file mode 100644 (file)
index 0000000..8dda526
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_setpgrp)
+SYSTEM(SYS_setpgrp)
diff --git a/mach/vax4/libbsd4_2/setprio.s b/mach/vax4/libbsd4_2/setprio.s
new file mode 100644 (file)
index 0000000..6fd1af9
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_setpriority)
+SYSTEM(SYS_setpriority)
diff --git a/mach/vax4/libbsd4_2/setquota.s b/mach/vax4/libbsd4_2/setquota.s
new file mode 100644 (file)
index 0000000..0a31315
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_setquota)
+SYSTEM(SYS_setquota)
diff --git a/mach/vax4/libbsd4_2/setregid.s b/mach/vax4/libbsd4_2/setregid.s
new file mode 100644 (file)
index 0000000..39d8d96
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_setregid)
+SYSTEM(SYS_setregid)
diff --git a/mach/vax4/libbsd4_2/setreuid.s b/mach/vax4/libbsd4_2/setreuid.s
new file mode 100644 (file)
index 0000000..fa63cbd
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_setreuid)
+SYSTEM(SYS_setreuid)
diff --git a/mach/vax4/libbsd4_2/setrlimit.s b/mach/vax4/libbsd4_2/setrlimit.s
new file mode 100644 (file)
index 0000000..6713d98
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_setrlimit)
+SYSTEM(SYS_setrlimit)
diff --git a/mach/vax4/libbsd4_2/setsockopt.s b/mach/vax4/libbsd4_2/setsockopt.s
new file mode 100644 (file)
index 0000000..1bc1bcb
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_setsockopt)
+SYSTEM(SYS_setsockopt)
diff --git a/mach/vax4/libbsd4_2/settimday.s b/mach/vax4/libbsd4_2/settimday.s
new file mode 100644 (file)
index 0000000..1aef4f4
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_settimeofday)
+SYSTEM(SYS_settimeofday)
diff --git a/mach/vax4/libbsd4_2/setuid.c b/mach/vax4/libbsd4_2/setuid.c
new file mode 100644 (file)
index 0000000..04a8734
--- /dev/null
@@ -0,0 +1,4 @@
+setuid(u)
+{
+       return setreuid(u,u);
+}
diff --git a/mach/vax4/libbsd4_2/shutdown.s b/mach/vax4/libbsd4_2/shutdown.s
new file mode 100644 (file)
index 0000000..b0dc134
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_shutdown)
+SYSTEM(SYS_shutdown)
diff --git a/mach/vax4/libbsd4_2/sigblock.s b/mach/vax4/libbsd4_2/sigblock.s
new file mode 100644 (file)
index 0000000..608f017
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_sigblock)
+SYSTEM(SYS_sigblock)
diff --git a/mach/vax4/libbsd4_2/signal.c b/mach/vax4/libbsd4_2/signal.c
new file mode 100644 (file)
index 0000000..5c829ae
--- /dev/null
@@ -0,0 +1,25 @@
+static long masks[32];
+static long flags[32];
+int (*
+signal(sig,handler))()
+       int (*handler)();
+{
+       struct {
+               int (*sv_handler)();
+               long    sv_mask;
+               long    sv_flags;
+       } v, ov;
+
+       v.sv_handler = handler;
+       v.sv_mask = masks[sig];
+       v.sv_flags = flags[sig];
+       if (sigvec(sig,&v, &ov) < 0) return (int (*)()) -1;
+       if (v.sv_mask != ov.sv_mask || v.sv_flags != ov.sv_flags) {
+               v.sv_mask = ov.sv_mask;
+               masks[sig] = ov.sv_mask;
+               v.sv_flags = ov.sv_flags;
+               flags[sig] = ov.sv_flags;
+               if (sigvec(sig,&v,(char *) 0) < 0) return (int (*)()) -1;
+       }
+       return ov.sv_handler;
+}
diff --git a/mach/vax4/libbsd4_2/sigpause.s b/mach/vax4/libbsd4_2/sigpause.s
new file mode 100644 (file)
index 0000000..1d3fb95
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_sigpause)
+SYSTEM(SYS_sigpause)
diff --git a/mach/vax4/libbsd4_2/sigsetmask.s b/mach/vax4/libbsd4_2/sigsetmask.s
new file mode 100644 (file)
index 0000000..a4034d4
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_sigsetmask)
+SYSTEM(SYS_sigsetmask)
diff --git a/mach/vax4/libbsd4_2/sigstack.s b/mach/vax4/libbsd4_2/sigstack.s
new file mode 100644 (file)
index 0000000..bd143e0
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_sigstack)
+SYSTEM(SYS_sigstack)
diff --git a/mach/vax4/libbsd4_2/sigvec.s b/mach/vax4/libbsd4_2/sigvec.s
new file mode 100644 (file)
index 0000000..c19c217
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_sigvec)
+SYSTEM(SYS_sigvec)
diff --git a/mach/vax4/libbsd4_2/socket.s b/mach/vax4/libbsd4_2/socket.s
new file mode 100644 (file)
index 0000000..dd032e4
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_socket)
+SYSTEM(SYS_socket)
diff --git a/mach/vax4/libbsd4_2/socketpair.s b/mach/vax4/libbsd4_2/socketpair.s
new file mode 100644 (file)
index 0000000..513c51c
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_socketpair)
+SYSTEM(SYS_socketpair)
diff --git a/mach/vax4/libbsd4_2/stat.s b/mach/vax4/libbsd4_2/stat.s
new file mode 100644 (file)
index 0000000..abdf853
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_stat)
+SYSTEM(SYS_stat)
diff --git a/mach/vax4/libbsd4_2/stime.c b/mach/vax4/libbsd4_2/stime.c
new file mode 100644 (file)
index 0000000..b13ee43
--- /dev/null
@@ -0,0 +1,9 @@
+stime(tp)
+       long *tp;
+{
+       struct { long l1,l2; } x;
+
+       x.l1 = *tp;
+       x.l2 = 0;
+       return settimeofday(&x, (char *) 0);
+}
diff --git a/mach/vax4/libbsd4_2/stty.c b/mach/vax4/libbsd4_2/stty.c
new file mode 100644 (file)
index 0000000..222310c
--- /dev/null
@@ -0,0 +1,7 @@
+#include <sgtty.h>
+int stty(fildes,argp)
+       int fildes ;
+       struct sgttyb *argp ;
+{
+       return ioctl(fildes,TIOCSETP,argp) ;
+}
diff --git a/mach/vax4/libbsd4_2/swapon.s b/mach/vax4/libbsd4_2/swapon.s
new file mode 100644 (file)
index 0000000..62d94a4
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_swapon)
+SYSTEM(SYS_swapon)
diff --git a/mach/vax4/libbsd4_2/symlink.s b/mach/vax4/libbsd4_2/symlink.s
new file mode 100644 (file)
index 0000000..ea02c67
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_symlink)
+SYSTEM(SYS_symlink)
diff --git a/mach/vax4/libbsd4_2/sync.s b/mach/vax4/libbsd4_2/sync.s
new file mode 100644 (file)
index 0000000..03eeae6
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_sync)
+SYSTEM(SYS_sync)
diff --git a/mach/vax4/libbsd4_2/syscall.h b/mach/vax4/libbsd4_2/syscall.h
new file mode 100644 (file)
index 0000000..b870d11
--- /dev/null
@@ -0,0 +1,118 @@
+#define DEFINE(sysn)   .globl sysn; .align 1; sysn: .word 0
+#define SYSTEM(sys)    chmk $sys; bcs err; ret; err: jmp cerror
+#define SYSNORET(sys)  chmk $sys; bcc ok; jmp cerror; ok:
+#define SYS_exit 1
+#define SYS_fork 2
+#define SYS_read 3
+#define SYS_write 4
+#define SYS_open 5
+#define SYS_close 6
+#define SYS_creat 8
+#define SYS_link 9
+#define SYS_unlink 10
+#define SYS_execv 11
+#define SYS_chdir 12
+#define SYS_mknod 14
+#define SYS_chmod 15
+#define SYS_chown 16
+#define SYS_lseek 19
+#define SYS_getpid 20
+#define SYS_mount 21
+#define SYS_umount 22
+#define SYS_getuid 24
+#define SYS_ptrace 26
+#define SYS_access 33
+#define SYS_sync 36
+#define SYS_kill 37
+#define SYS_stat 38
+#define SYS_lstat 40
+#define SYS_dup 41
+#define SYS_pipe 42
+#define SYS_profil 44
+#define SYS_getgid 47
+#define SYS_acct 51
+#define SYS_ioctl 54
+#define SYS_reboot 55
+#define SYS_symlink 57
+#define SYS_readlink 58
+#define SYS_execve 59
+#define SYS_umask 60
+#define SYS_chroot 61
+#define SYS_fstat 62
+#define SYS_getpagesize 64
+#define SYS_mremap 65
+#define SYS_vfork 65
+#define SYS_sbrk 69
+#define SYS_sstk 70
+#define SYS_mmap 71
+#define SYS_vadvise 72
+#define SYS_munmap 73
+#define SYS_mprotect 74
+#define SYS_madvise 75
+#define SYS_vhangup 76
+#define SYS_mincore 78
+#define SYS_getgroups 79
+#define SYS_setgroups 80
+#define SYS_getpgrp 81
+#define SYS_setpgrp 82
+#define SYS_setitimer 83
+#define SYS_wait 84
+#define SYS_swapon 85
+#define SYS_getitimer 86
+#define SYS_gethostname 87
+#define SYS_sethostname 88
+#define SYS_getdtablesize 89
+#define SYS_dup2 90
+#define SYS_getdopt 91
+#define SYS_fcntl 92
+#define SYS_select 93
+#define SYS_setdopt 94
+#define SYS_fsync 95
+#define SYS_setpriority 96
+#define SYS_socket 97
+#define SYS_connect 98
+#define SYS_accept 99
+#define SYS_getpriority 100
+#define SYS_send 101
+#define SYS_recv 102
+#define SYS_bind 104
+#define SYS_setsockopt 105
+#define SYS_listen 106
+#define SYS_sigvec 108
+#define SYS_sigblock 109
+#define SYS_sigsetmask 110
+#define SYS_sigpause 111
+#define SYS_sigstack 112
+#define SYS_recvmsg 113
+#define SYS_sendmsg 114
+#define SYS_gettimeofday 116
+#define SYS_getrusage 117
+#define SYS_getsockopt 118
+#define SYS_readv 120
+#define SYS_writev 121
+#define SYS_settimeofday 122
+#define SYS_fchown 123
+#define SYS_fchmod 124
+#define SYS_recvfrom 125
+#define SYS_setreuid 126
+#define SYS_setregid 127
+#define SYS_rename 128
+#define SYS_truncate 129
+#define SYS_ftruncate 130
+#define SYS_flock 131
+#define SYS_sendto 133
+#define SYS_shutdown 134
+#define SYS_socketpair 135
+#define SYS_mkdir 136
+#define SYS_rmdir 137
+#define SYS_utimes 138
+#define SYS_revoke 140
+#define SYS_getpeername 141
+#define SYS_gethostid 142
+#define SYS_sethostid 143
+#define SYS_getrlimit 144
+#define SYS_setrlimit 145
+#define SYS_killpg 146
+#define SYS_setquota 148
+#define SYS_quota 149
+#define SYS_getsockname 150
diff --git a/mach/vax4/libbsd4_2/syscall.s b/mach/vax4/libbsd4_2/syscall.s
new file mode 100644 (file)
index 0000000..14be065
--- /dev/null
@@ -0,0 +1,9 @@
+#include "syscall.h"
+DEFINE(_syscall)
+       movl    4(ap),r0
+       subl3   $1,(ap)+,(ap)
+       chmk    r0
+       bcs     err
+       ret
+err:
+       jmp     cerror
diff --git a/mach/vax4/libbsd4_2/tell.c b/mach/vax4/libbsd4_2/tell.c
new file mode 100644 (file)
index 0000000..49e2a91
--- /dev/null
@@ -0,0 +1,7 @@
+long
+tell(f)
+{
+       long lseek();
+
+       return lseek(f, 0L, 1);
+}
diff --git a/mach/vax4/libbsd4_2/time.c b/mach/vax4/libbsd4_2/time.c
new file mode 100644 (file)
index 0000000..3dd1eea
--- /dev/null
@@ -0,0 +1,12 @@
+long
+time(loc)
+       long *loc;
+{
+       struct { long l1,l2; } t1;
+
+       if (gettimeofday(&t1, (char *) 0) < 0) {
+               return -1;
+       }
+       if (loc) *loc = t1.l1;
+       return t1.l1;
+}
diff --git a/mach/vax4/libbsd4_2/times.c b/mach/vax4/libbsd4_2/times.c
new file mode 100644 (file)
index 0000000..4e23d92
--- /dev/null
@@ -0,0 +1,16 @@
+#include <sys/types.h>
+
+#define Xval(xx)       ((xx).l1*60+(xx).l2/(100000/6))
+
+times(bp)
+       struct { time_t l1,l2,l3,l4;} *bp;
+{
+       struct { struct { long l1,l2; }s1,s2; long x[20]; } t;
+       if (getrusage(0,&t) < 0) return -1;
+       bp->l1 = Xval(t.s1);
+       bp->l2 = Xval(t.s2);
+       if (getrusage(-1,&t) < 0) return -1;
+       bp->l3 = Xval(t.s1);
+       bp->l4 = Xval(t.s2);
+       return 0;
+}
diff --git a/mach/vax4/libbsd4_2/truncate.s b/mach/vax4/libbsd4_2/truncate.s
new file mode 100644 (file)
index 0000000..45c5e2e
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_truncate)
+SYSTEM(SYS_truncate)
diff --git a/mach/vax4/libbsd4_2/umask.s b/mach/vax4/libbsd4_2/umask.s
new file mode 100644 (file)
index 0000000..11229ba
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_umask)
+SYSTEM(SYS_umask)
diff --git a/mach/vax4/libbsd4_2/umount.s b/mach/vax4/libbsd4_2/umount.s
new file mode 100644 (file)
index 0000000..88d9ca5
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_umount)
+SYSTEM(SYS_umount)
diff --git a/mach/vax4/libbsd4_2/unlink.s b/mach/vax4/libbsd4_2/unlink.s
new file mode 100644 (file)
index 0000000..830a0ab
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_unlink)
+SYSTEM(SYS_unlink)
diff --git a/mach/vax4/libbsd4_2/utime.c b/mach/vax4/libbsd4_2/utime.c
new file mode 100644 (file)
index 0000000..8c265e1
--- /dev/null
@@ -0,0 +1,13 @@
+#include <sys/types.h>
+
+utime(file, timep)
+       char *file;
+       time_t timep[2];
+{
+       struct { long l1,l2,l3,l4; } x;
+
+       x.l2 = x.l4 = 0;
+       x.l1 = timep[0];
+       x.l3 = timep[1];
+       return utimes(file,&x);
+}
diff --git a/mach/vax4/libbsd4_2/utimes.s b/mach/vax4/libbsd4_2/utimes.s
new file mode 100644 (file)
index 0000000..7d4ab02
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_utimes)
+SYSTEM(SYS_utimes)
diff --git a/mach/vax4/libbsd4_2/vadvise.s b/mach/vax4/libbsd4_2/vadvise.s
new file mode 100644 (file)
index 0000000..b71fb18
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_vadvise)
+SYSTEM(SYS_vadvise)
diff --git a/mach/vax4/libbsd4_2/vfork.s b/mach/vax4/libbsd4_2/vfork.s
new file mode 100644 (file)
index 0000000..3f5a721
--- /dev/null
@@ -0,0 +1,17 @@
+#include "syscall.h"
+DEFINE(_vfork)
+       movl    16(fp),r2
+       movab   newret,16(fp)
+       ret                     # cleans stack
+newret:
+       chmk    $SYS_vfork
+       bcs     err
+       tstl    r1
+       beql    parent
+       clrl    r0
+parent:
+       jmp     (r2)
+err:
+       movl    r0,_errno
+       mnegl   $1,r0
+       jmp     (r2)
diff --git a/mach/vax4/libbsd4_2/vhangup.s b/mach/vax4/libbsd4_2/vhangup.s
new file mode 100644 (file)
index 0000000..f6da68d
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_vhangup)
+SYSTEM(SYS_vhangup)
diff --git a/mach/vax4/libbsd4_2/wait.s b/mach/vax4/libbsd4_2/wait.s
new file mode 100644 (file)
index 0000000..0807bdf
--- /dev/null
@@ -0,0 +1,8 @@
+#include "syscall.h"
+DEFINE(_wait)
+SYSNORET(SYS_wait)
+       tstl    4(ap)
+       beql    out
+       movl    r1,*4(ap)
+out:
+       ret
diff --git a/mach/vax4/libbsd4_2/wait3.s b/mach/vax4/libbsd4_2/wait3.s
new file mode 100644 (file)
index 0000000..9ac2829
--- /dev/null
@@ -0,0 +1,14 @@
+#include "syscall.h"
+DEFINE(_wait3)
+       movl    8(ap),r0
+       movl    12(ap),r1
+       bispsw  $0xf
+       chmk    $SYS_wait
+       bcs     err
+       tstl    4(ap)
+       beql    out
+       movl    r1,*4(ap)
+out:
+       ret
+err:
+       jmp     cerror
diff --git a/mach/vax4/libbsd4_2/write.s b/mach/vax4/libbsd4_2/write.s
new file mode 100644 (file)
index 0000000..9d37374
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_write)
+SYSTEM(SYS_write)
diff --git a/mach/vax4/libbsd4_2/writev.s b/mach/vax4/libbsd4_2/writev.s
new file mode 100644 (file)
index 0000000..49e531b
--- /dev/null
@@ -0,0 +1,3 @@
+#include "syscall.h"
+DEFINE(_writev)
+SYSTEM(SYS_writev)