# 2.11BSD#431 - /usr/src/lib/libc/pdp/sys/vfork.s

##### Functions

    _vfork            X

       1: /*
       2:  * Copyright (c) 1987 Regents of the University of California.
       3:  * All rights reserved.  The Berkeley software License Agreement
       4:  * specifies the terms and conditions for redistribution.
       5:  */
       6:
       7: #ifdef SYSLIBC_SCCS
       8: _sccsid: <@(#)vfork.s	2.6 (2.11BSD) 1995/05/13\0>
       9:         .even
      10: #endif SYSLIBC_SCCS
      11:
      12: /*
      13:  * XXX - this routine can't use SYSCALL!!!
      14:  *
      15:  * pid = vfork();
      16:  *
      17:  * pid == 0 in child process; pid == -1 means error return in child.
      18:  * Since the parent and child share the stack, the return address for the
      19:  * parent would be overwritten by the child.  Therefore, save the return
      20:  * address in r1 and "return" by a jump indirect.
      21:  */
      22: #include "SYS.h"
      23:
      24: .globl  __ovno
      25:
      26: .bss
      27: savov:  .=.+2
      28: .text
      29:
      30: ENTRY(vfork)
      31:         mov     (sp)+,r1        / save return address
      32:         mov     __ovno,savov    / save __ovno for parent
      33:         SYS(vfork)              / (takes no parameters)
          /
          /   trap 66 -> [kernel] -> syscall() -> via sysent[] -> handler: vfork
          /
      34:         br      1f              / child returns here
      35:         bcs     2f              / parent returns here
      36:         mov     savov,__ovno    / restore ovno in case child switched
      37:         jmp     (r1)            / "return" to saved location
      38: 1:
      39:         clr     r0
      40:         jmp     (r1)
      41: 2:
      42:         mov     r0,_errno
      43:         mov     $-1,r0
      44:         jmp     (r1)            / "return" to saved location

#### Defined functions

_sccsid defined in line 8; never used
_vfork defined in line 30; used 42 times

- in /usr/include/unistd.h line 91
- in /usr/src/bin/cc.c line 357
- in /usr/src/bin/chpass/chpass.c line 390, 412
- in /usr/src/bin/csh/sh.sem.c line 143
- in /usr/src/bin/make/dosys.c line 39, 124
- in /usr/src/bin/passwd/passwd.c line 259
- in /usr/src/bin/rcp.c line 398
- in /usr/src/games/hunt/hunt.c line 468
- in /usr/src/lib/libc/gen/popen.c line 69
- in /usr/src/lib/libc/gen/syslog.c line 188
- in /usr/src/lib/libc/gen/system.c line 57
- in /usr/src/libexec/fingerd/fingerd.c line 140
- in /usr/src/libexec/ftpd/popen.c line 91
- in /usr/src/new/OLD/apl/src/apl.h line 551
- in /usr/src/new/PORT/B/src/bed/comm.c line 125
- in /usr/src/new/PORT/apl/src/apl.h line 551
- in /usr/src/new/PORT/perl.1.0.0/arg.c line 1970
- in /usr/src/new/PORT/perl.1.0.10/arg.c line 1998
- in /usr/src/new/PORT/perl.1.0.16/arg.c line 2022
- in /usr/src/new/kermit5.188/ckufio.c line 1367, 2894
- in /usr/src/new/kermit5.188/ckustr.c line 391
- in /usr/src/new/nntp/server/spawn.c line 144
- in /usr/src/new/rn/util.c line 47
- in /usr/src/sbin/mount/mount.c line 292
- in /usr/src/ucb/Mail/cmd2.c line 367
- in /usr/src/ucb/Mail/popen.c line 201
- in /usr/src/ucb/ex/ex_unix.c line 157
- in /usr/src/ucb/window/wwspawn.c line 29
- in /usr/src/usr.bin/find/find.c line 562
- in /usr/src/usr.bin/tip/cmds.c line 797
- in /usr/src/usr.bin/xargs/xargs.c line 279
- in /usr/src/usr.bin/xinstall/xinstall.c line 289
- in /usr/src/usr.lib/libstubs/stubs.c line 240
- in /usr/src/usr.sbin/accton/accton.c line 188
- in /usr/src/usr.sbin/cron/do_command.c line 126
- in /usr/src/usr.sbin/cron/popen.c line 95
- in /usr/src/usr.sbin/edquota/edquota.c line 317
- in /usr/src/usr.sbin/vipw/vipw.c line 224, 245

#### Defined variables

savov defined in line 27; used 2 times

- in line 32-36(2)

Last modified: 1995-05-14 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 953 |