Bell 32V development
authorTom London <tbl@research.uucp>
Wed, 29 Nov 1978 04:53:55 +0000 (23:53 -0500)
committerTom London <tbl@research.uucp>
Wed, 29 Nov 1978 04:53:55 +0000 (23:53 -0500)
Work on file usr/src/libc/gen/ttytest.c
Work on file usr/src/libc/sys/umount.s
Work on file usr/src/libc/sys/unlink.s
Work on file usr/src/libc/sys/wait.s
Work on file usr/src/libc/sys/write.s

Co-Authored-By: John Reiser <jfr@research.uucp>
Synthesized-from: 32v

usr/src/libc/gen/ttytest.c [new file with mode: 0644]
usr/src/libc/sys/umount.s [new file with mode: 0755]
usr/src/libc/sys/unlink.s [new file with mode: 0644]
usr/src/libc/sys/wait.s [new file with mode: 0755]
usr/src/libc/sys/write.s [new file with mode: 0755]

diff --git a/usr/src/libc/gen/ttytest.c b/usr/src/libc/gen/ttytest.c
new file mode 100644 (file)
index 0000000..de49f2f
--- /dev/null
@@ -0,0 +1,5 @@
+#include "stdio.h"
+main() {
+printf("\nttyname(fd)=%s\n", ttyname(0));
+printf("\nttyname=%s\n", ttyname(stdin));
+}
diff --git a/usr/src/libc/sys/umount.s b/usr/src/libc/sys/umount.s
new file mode 100755 (executable)
index 0000000..bd993a7
--- /dev/null
@@ -0,0 +1,15 @@
+# C library -- umount/
+
+       .set    umount,22
+.globl _umount
+.globl cerror
+.comm  _errno,4
+
+_umount:
+       .word   0x0000
+       chmk    $umount
+       bcc     noerror
+       jmp     cerror
+noerror:
+       clrl    r0
+       ret
diff --git a/usr/src/libc/sys/unlink.s b/usr/src/libc/sys/unlink.s
new file mode 100644 (file)
index 0000000..1846a6e
--- /dev/null
@@ -0,0 +1,17 @@
+# C library -- unlink
+
+# error = unlink(string);
+#
+
+       .set    unlink,10
+.globl _unlink
+.globl  cerror
+
+_unlink:
+       .word   0x0000
+       chmk    $unlink
+       bcc     noerror
+       jmp     cerror
+noerror:
+       clrl    r0
+       ret
diff --git a/usr/src/libc/sys/wait.s b/usr/src/libc/sys/wait.s
new file mode 100755 (executable)
index 0000000..94267fb
--- /dev/null
@@ -0,0 +1,25 @@
+# C library -- wait
+
+# pid = wait(0);
+#   or,
+# pid = wait(&status);
+#
+# pid == -1 if error
+# status indicates fate of process, if given
+
+       .set    wait,7
+.globl _wait
+.globl  cerror
+
+       .align  1
+_wait:
+       .word   0x0000
+       chmk    $wait
+       bcc     noerror
+       jmp     cerror
+noerror:
+       tstl    4(ap)           # status desired?
+       beql    nostatus        # no
+       movl    r1,*4(ap)       # store child's status
+nostatus:
+       ret
diff --git a/usr/src/libc/sys/write.s b/usr/src/libc/sys/write.s
new file mode 100755 (executable)
index 0000000..2b6421f
--- /dev/null
@@ -0,0 +1,17 @@
+# C library -- write
+
+# nwritten = write(file, buffer, count);
+#
+# nwritten == -1 means error
+
+       .set    write,4
+.globl _write
+.globl  cerror
+
+_write:
+       .word   0x0000
+       chmk    $write
+       bcc     noerror
+       jmp     cerror
+noerror:
+       ret