date and time created 92/02/29 12:55:21 by bostic
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Sun, 1 Mar 1992 04:55:21 +0000 (20:55 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Sun, 1 Mar 1992 04:55:21 +0000 (20:55 -0800)
SCCS-vsn: lib/libc/mips/sys/Ovfork.s 5.1

usr/src/lib/libc/mips/sys/Ovfork.s [new file with mode: 0644]

diff --git a/usr/src/lib/libc/mips/sys/Ovfork.s b/usr/src/lib/libc/mips/sys/Ovfork.s
new file mode 100644 (file)
index 0000000..9e1c44c
--- /dev/null
@@ -0,0 +1,34 @@
+/*-
+ * Copyright (c) 1991 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Ralph Campbell.
+ *
+ * %sccs.include.redist.c%
+ */
+
+#include "SYS.h"
+
+#if defined(LIBC_SCCS) && !defined(lint)
+       ASMSTR("@(#)Ovfork.s    5.1 (Berkeley) %G%")
+#endif /* LIBC_SCCS and not lint */
+
+/*
+ * pid = vfork();
+ *
+ * v1 == 0 in parent process, v1 == 1 in child process.
+ * v0 == pid of child in parent, v0 == pid of parent in child.
+ */
+
+LEAF(vfork)
+       li      v0, SYS_vfork           # system call number for vfork
+       syscall
+       beq     a3, zero, 1f            # jump if no errors
+       j       _cerror
+1:
+       beq     v1, zero, 2f            # parent process ?
+       move    v0, zero                # return zero in child
+2:
+       j       ra
+END(vfork)