diff options
author | 2012-04-12 12:33:03 +0000 | |
---|---|---|
committer | 2012-04-12 12:33:03 +0000 | |
commit | 78f78c26c3995239464fa4d653a026095e06effa (patch) | |
tree | a27a0006a7744ad73e7478c4f882ec9fbccd56f5 /lib/libc/sys | |
parent | Revert change not intended to be committed. (diff) | |
download | wireguard-openbsd-78f78c26c3995239464fa4d653a026095e06effa.tar.xz wireguard-openbsd-78f78c26c3995239464fa4d653a026095e06effa.zip |
remove rfork(); ok guenther miod
Diffstat (limited to 'lib/libc/sys')
-rw-r--r-- | lib/libc/sys/Makefile.inc | 83 | ||||
-rw-r--r-- | lib/libc/sys/rfork.2 | 185 |
2 files changed, 40 insertions, 228 deletions
diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc index 0afa15f8842..a8233a699b3 100644 --- a/lib/libc/sys/Makefile.inc +++ b/lib/libc/sys/Makefile.inc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.inc,v 1.101 2012/04/12 11:16:24 deraadt Exp $ +# $OpenBSD: Makefile.inc,v 1.102 2012/04/12 12:33:04 deraadt Exp $ # $NetBSD: Makefile.inc,v 1.35 1995/10/16 23:49:07 jtc Exp $ # @(#)Makefile.inc 8.1 (Berkeley) 6/17/93 @@ -6,12 +6,11 @@ .PATH: ${LIBCSRCDIR}/arch/${MACHINE_CPU}/sys ${LIBCSRCDIR}/sys # modules with non-default implementations on at least one architecture: -SRCS+= Ovfork.S brk.S cerror.S exect.S fork.S rfork.S \ +SRCS+= Ovfork.S brk.S cerror.S exect.S fork.S \ sbrk.S sigpending.S sigprocmask.S sigreturn.S \ sigsuspend.S syscall.S tfork_thread.S -LSRCS+= Lint_Ovfork.c Lint_brk.c Lint_exect.c Lint_fork.c \ - Lint_rfork.c Lint_sbrk.c \ +LSRCS+= Lint_Ovfork.c Lint_brk.c Lint_exect.c Lint_fork.c Lint_sbrk.c \ Lint_sigpending.c Lint_sigprocmask.c Lint_sigreturn.c \ Lint_sigsuspend.c Lint_syscall.c Lint_crt.c Lint_environ.c \ Lint_setjmp.c Lint_longjmp.c \ @@ -214,41 +213,41 @@ LintSysPseudoNoerr.c: ${LIBCSRCDIR}/sys/makelintstub.sh \ @sh ${LIBCSRCDIR}/sys/makelintstub.sh -o ${.TARGET} -p \ -s ${DESTDIR}/usr/include/sys/syscall.h ${PSEUDO_NOERR} -MAN+= accept.2 access.2 acct.2 adjfreq.2 adjtime.2 bind.2 brk.2 chdir.2 \ - chflags.2 \ - chmod.2 chown.2 chroot.2 clock_gettime.2 close.2 closefrom.2 connect.2 \ - dup.2 execve.2 _exit.2 fcntl.2 fhopen.2 \ - flock.2 fork.2 fsync.2 getdirentries.2 getdtablecount.2 \ - getfh.2 getfsstat.2 getgid.2 getgroups.2 getitimer.2 getlogin.2 \ - getpeername.2 getpgrp.2 getrtable.2 __get_tcb.2 \ - getpid.2 getpriority.2 getrlimit.2 getrusage.2 getsid.2 getsockname.2 \ - getsockopt.2 gettimeofday.2 getuid.2 intro.2 issetugid.2 ioctl.2 \ - kill.2 kqueue.2 ktrace.2 link.2 \ - listen.2 lseek.2 mkdir.2 mkfifo.2 mknod.2 madvise.2 \ - mquery.2 mincore.2 minherit.2 mlock.2 mlockall.2 \ - mmap.2 mount.2 mprotect.2 msync.2 munmap.2 nanosleep.2 \ - nfssvc.2 open.2 pathconf.2 \ - pipe.2 profil.2 poll.2 ptrace.2 quotactl.2 read.2 readlink.2 reboot.2 \ - recv.2 rename.2 revoke.2 rfork.2 rmdir.2 select.2 send.2 setgroups.2 \ - setpgid.2 setregid.2 setreuid.2 setresuid.2 setsid.2 setuid.2 \ - shutdown.2 sigaction.2 sigaltstack.2 sigpending.2 sigprocmask.2 \ - sigreturn.2 sigsuspend.2 socket.2 socketpair.2 stat.2 \ - statfs.2 swapctl.2 symlink.2 sync.2 sysarch.2 syscall.2 \ - __thrsigdivert.2 __thrsleep.2 truncate.2 \ - umask.2 unlink.2 utimes.2 vfork.2 wait.2 write.2 - -MAN+= msgctl.2 shmctl.2 shmat.2 semop.2 semget.2 semctl.2 msgsnd.2 msgrcv.2 \ - msgget.2 shmget.2 +MAN+= __get_tcb.2 __thrsigdivert.2 __thrsleep.2 _exit.2 accept.2 \ + access.2 acct.2 adjfreq.2 adjtime.2 bind.2 brk.2 chdir.2 \ + chflags.2 chmod.2 chown.2 chroot.2 clock_gettime.2 close.2 \ + closefrom.2 connect.2 dup.2 execve.2 fcntl.2 fhopen.2 \ + flock.2 fork.2 fsync.2 getdirentries.2 getfh.2 getfsstat.2 \ + getgid.2 getgroups.2 getitimer.2 getlogin.2 getpeername.2 \ + getpgrp.2 getpid.2 getpriority.2 getrlimit.2 getrtable.2 \ + getrusage.2 getsid.2 getsockname.2 getsockopt.2 \ + gettimeofday.2 getuid.2 intro.2 ioctl.2 issetugid.2 \ + kill.2 kqueue.2 ktrace.2 link.2 listen.2 lseek.2 madvise.2 \ + mincore.2 minherit.2 mkdir.2 mkfifo.2 mknod.2 mlock.2 \ + mlockall.2 mmap.2 mount.2 mprotect.2 mquery.2 msgctl.2 \ + msgget.2 msgrcv.2 msgsnd.2 msync.2 munmap.2 nanosleep.2 \ + nfssvc.2 open.2 pathconf.2 pipe.2 poll.2 profil.2 \ + ptrace.2 quotactl.2 read.2 readlink.2 reboot.2 recv.2 \ + rename.2 revoke.2 rmdir.2 select.2 semctl.2 semget.2 \ + semop.2 send.2 setgroups.2 setpgid.2 setregid.2 \ + setresuid.2 setreuid.2 setsid.2 setuid.2 shmat.2 shmctl.2 \ + shmget.2 shutdown.2 sigaction.2 sigaltstack.2 sigpending.2 \ + sigprocmask.2 sigreturn.2 sigsuspend.2 socket.2 \ + socketpair.2 stat.2 statfs.2 swapctl.2 symlink.2 \ + sync.2 sysarch.2 syscall.2 truncate.2 umask.2 unlink.2 \ + utimes.2 vfork.2 wait.2 write.2 +MLINKS+=__get_tcb.2 __set_tcb.2 +MLINKS+=__thrsleep.2 __thrwakeup.2 MLINKS+=access.2 faccessat.2 MLINKS+=brk.2 sbrk.2 -MLINKS+=dup.2 dup2.2 MLINKS+=chdir.2 fchdir.2 MLINKS+=chflags.2 fchflags.2 MLINKS+=chmod.2 fchmod.2 chmod.2 fchmodat.2 MLINKS+=chown.2 fchown.2 chown.2 fchownat.2 chown.2 lchown.2 -MLINKS+=clock_gettime.2 clock_settime.2 MLINKS+=clock_gettime.2 clock_getres.2 +MLINKS+=clock_gettime.2 clock_settime.2 +MLINKS+=dup.2 dup2.2 MLINKS+=execve.2 exect.2 MLINKS+=fhopen.2 fhstat.2 fhopen.2 fhstatfs.2 MLINKS+=getgid.2 getegid.2 @@ -263,14 +262,13 @@ MLINKS+=getpgrp.2 getpgid.2 MLINKS+=getpid.2 getppid.2 MLINKS+=getpriority.2 setpriority.2 MLINKS+=getrlimit.2 setrlimit.2 -MLINKS+=getsockopt.2 setsockopt.2 MLINKS+=getrtable.2 setrtable.2 -MLINKS+=__get_tcb.2 __set_tcb.2 +MLINKS+=getsockopt.2 setsockopt.2 MLINKS+=gettimeofday.2 settimeofday.2 MLINKS+=getuid.2 geteuid.2 +MLINKS+=intro.2 errno.2 MLINKS+=kqueue.2 kevent.2 kqueue.2 EV_SET.2 MLINKS+=link.2 linkat.2 -MLINKS+=intro.2 errno.2 MLINKS+=madvise.2 posix_madvise.2 MLINKS+=mkdir.2 mkdirat.2 MLINKS+=mkfifo.2 mkfifoat.2 @@ -282,28 +280,27 @@ MLINKS+=open.2 openat.2 MLINKS+=pathconf.2 fpathconf.2 MLINKS+=read.2 readv.2 read.2 pread.2 read.2 preadv.2 MLINKS+=readlink.2 readlinkat.2 -MLINKS+=rename.2 renameat.2 MLINKS+=recv.2 recvfrom.2 recv.2 recvmsg.2 +MLINKS+=rename.2 renameat.2 +MLINKS+=select.2 FD_ISSET.3 select.2 FD_ZERO.3 +MLINKS+=select.2 FD_SET.3 select.2 FD_CLR.3 MLINKS+=send.2 sendmsg.2 send.2 sendto.2 MLINKS+=setpgid.2 setpgrp.2 -MLINKS+=setuid.2 setegid.2 setuid.2 seteuid.2 setuid.2 setgid.2 MLINKS+=setresuid.2 getresgid.2 setresuid.2 getresuid.2 MLINKS+=setresuid.2 setresgid.2 +MLINKS+=setuid.2 setegid.2 setuid.2 seteuid.2 setuid.2 setgid.2 MLINKS+=shmat.2 shmdt.2 -MLINKS+=stat.2 fstat.2 stat.2 fstatat.2 stat.2 lstat.2 MLINKS+=stat.2 S_ISBLK.2 stat.2 S_ISCHR.2 stat.2 S_ISDIR.2 MLINKS+=stat.2 S_ISFIFO.2 stat.2 S_ISLNK.2 stat.2 S_ISREG.2 stat.2 S_ISSOCK.2 +MLINKS+=stat.2 fstat.2 stat.2 fstatat.2 stat.2 lstat.2 MLINKS+=statfs.2 fstatfs.2 MLINKS+=symlink.2 symlinkat.2 MLINKS+=syscall.2 __syscall.2 -MLINKS+=__thrsleep.2 __thrwakeup.2 MLINKS+=truncate.2 ftruncate.2 MLINKS+=unlink.2 unlinkat.2 MLINKS+=utimes.2 futimens.2 utimes.2 futimes.2 utimes.2 utimensat.2 -MLINKS+=wait.2 wait3.2 wait.2 wait4.2 wait.2 waitpid.2 -MLINKS+=write.2 writev.2 write.2 pwrite.2 write.2 pwritev.2 -MLINKS+=select.2 FD_SET.3 select.2 FD_CLR.3 -MLINKS+=select.2 FD_ISSET.3 select.2 FD_ZERO.3 +MLINKS+=wait.2 WEXITSTATUS.2 wait.2 WCOREDUMP.2 wait.2 WSTOPSIG.2 MLINKS+=wait.2 WIFCONTINUED.2 wait.2 WIFEXITED.2 MLINKS+=wait.2 WIFSIGNALED.2 wait.2 WIFSTOPPED.2 wait.2 WTERMSIG.2 -MLINKS+=wait.2 WEXITSTATUS.2 wait.2 WCOREDUMP.2 wait.2 WSTOPSIG.2 +MLINKS+=wait.2 wait3.2 wait.2 wait4.2 wait.2 waitpid.2 +MLINKS+=write.2 writev.2 write.2 pwrite.2 write.2 pwritev.2 diff --git a/lib/libc/sys/rfork.2 b/lib/libc/sys/rfork.2 deleted file mode 100644 index 1f515d5ff66..00000000000 --- a/lib/libc/sys/rfork.2 +++ /dev/null @@ -1,185 +0,0 @@ -.\" $OpenBSD: rfork.2,v 1.25 2010/06/29 17:54:35 tedu Exp $ -.\" -.\" Copyright (c) 2003 Jason McIntyre <jmc@openbsd.org> -.\" -.\" Permission to use, copy, modify, and distribute this software for any -.\" purpose with or without fee is hereby granted, provided that the above -.\" copyright notice and this permission notice appear in all copies. -.\" -.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -.\" -.Dd $Mdocdate: June 29 2010 $ -.Dt RFORK 2 -.Os -.Sh NAME -.Nm rfork -.Nd control new processes -.Sh SYNOPSIS -.Fd #include <sys/param.h> -.Fd #include <unistd.h> -.Ft int -.Fn rfork "int flags" -.Sh DESCRIPTION -The fork functions -.Po -.Xr fork 2 , -.Xr vfork 2 , -and -.Fn rfork -.Pc -create new processes. -The new process -.Pq child process -is an exact copy of the calling process -.Pq parent process , -except as outlined in the -.Xr fork 2 -manual page. -.Fn rfork -is used to manipulate the resources of the parent process and the -child process. -.Pp -Operations currently supported include whether to copy or share the file -descriptor table between the two processes, whether to share the address -space, and whether the parent should -.Xr wait 2 -for the child process to -.Xr _exit 2 . -.Fn rfork -takes a single argument, -.Fa flags , -which controls which of these resources should be manipulated. -They are defined in the header file -.Aq Pa sys/param.h -and are the logical OR of one or more of the following: -.Bl -tag -width "RFNOWAIT" -.\" .It Dv RFNAMEG -.\" New Plan 9 -.\" .Sq name space . -.\" This is a Plan 9 specific flag, and is not implemented. -.\" .It Dv RFENVG -.\" Copy Plan 9 -.\" .Sq env space . -.\" This is a Plan 9 specific flag, and is not implemented. -.It Dv RFFDG -Copy the parent's file descriptor table. -If this flag is unset, the parent and child will share the parent's -file descriptor table. -Descriptors will remain in existence until they are closed by all -child processes using the table copies as well as by the parent process. -May not be used in conjunction with -.Dv RFCFDG . -.\" .It Dv RFNOTEG -.\" Create new Plan 9 -.\" .Sq note group . -.\" This is a Plan 9 specific flag, and is not implemented. -.It Dv RFPROC -Create a new process. -The current implementation requires this flag to always be set. -.It Dv RFMEM -Force sharing of the entire address space between the parent and child -processes. -The child will then inherit all the shared segments the parent process owns. -Subsequent forks by the parent will then propagate the shared -data and BSS segments among children. -.It Dv RFNOWAIT -Child processes will have their resources reaped immediately and -implicitly when they terminate instead of turning into zombies, -so the parent process may not call -.Xr wait 2 -to collect their exit statuses and have their resources released -explicitly. -.\" .It Dv RFCNAMEG -.\" Zero Plan 9 -.\" .Sq name space . -.\" This is a Plan 9 specific flag, and is not implemented. -.\" .It Dv RFCENVG -.\" Zero Plan 9 -.\" .Sq env space . -.\" This is a Plan 9 specific flag, and is not implemented. -.It Dv RFCFDG -Zero the child's file descriptor table -.Pq i.e. start with a blank file descriptor table . -May not be used in conjunction with -.Dv RFFDG . -.It Dv RFTHREAD -Create a kernel thread in the current process instead of a separate -process. -Must be combined with -.Dv RFMEM . -Automatically enables -.Dv RFNOWAIT . -The kern.rthreads sysctl must be enabled for this to succeed. -.El -.Pp -.Xr fork 2 -can be implemented as a call to -.Fn rfork -using "RFFDG|RFPROC", but isn't for backwards compatibility. -If a process has file descriptor table sharing active, setuid or setgid -programs will not -.Xr execve 2 -with extra privileges. -.Sh RETURN VALUES -The parent process returns the process ID -.Pq PID -of the child process. -The child process returns 0. -The range of the process ID is defined in -.Aq Pa sys/proc.h -and is currently between 1 and 32766, inclusive. -.Sh ERRORS -.Fn rfork -will fail and no child process will be created if: -.Bl -tag -width Er -.It Bq Er ENOMEM -Cannot allocate memory. -The new process image required more memory than was allowed by the hardware or -by system-imposed memory management constraints. -A lack of swap space is normally temporary; however, a lack of core is not. -Soft limits may be increased to their corresponding hard limits. -.It Bq Er EINVAL -Invalid argument. -Some invalid argument was supplied. -.It Bq Er EAGAIN -Resource temporarily unavailable. -The system-imposed limit on the total -number of processes under execution would be exceeded. -This limit is configuration-dependent. -.It Bq Er EAGAIN -Resource temporarily unavailable. -The system-imposed limit -.Dv MAXUPRC -on the total number of processes under execution by a single user would be -exceeded. -.Dv MAXUPRC -is currently defined in -.Aq Pa sys/param.h -as -.Dv CHILD_MAX , -which is currently defined as 80 in -.Aq Pa sys/syslimits.h . -.It Bq Er ENOTSUP -The -.Dv RFTHREAD -flag was set but the kern.rthreads sysctl was not enabled. -.El -.Sh SEE ALSO -.Xr _exit 2 , -.Xr execve 2 , -.Xr fork 2 , -.Xr intro 2 , -.Xr vfork 2 -.Sh HISTORY -The -.Fn rfork -function first appeared in Plan 9. -.Sh BUGS -.Dv RFTHREAD -cannot be used from C, as the two threads would return on the same stack. |