Changeset View
Changeset View
Standalone View
Standalone View
lib/libc/sys/rfork.2
.\" | .\" | ||||
.\" This manual page is taken directly from Plan9, and modified to | .\" This manual page is taken directly from Plan9, and modified to | ||||
.\" describe the actual BSD implementation. Permission for | .\" describe the actual BSD implementation. Permission for | ||||
.\" use of this page comes from Rob Pike <rob@plan9.att.com>. | .\" use of this page comes from Rob Pike <rob@plan9.att.com>. | ||||
.\" | .\" | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd July 12, 2011 | .Dd February 1, 2019 | ||||
.Dt RFORK 2 | .Dt RFORK 2 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm rfork | .Nm rfork | ||||
.Nd manipulate process resources | .Nd manipulate process resources | ||||
.Sh LIBRARY | .Sh LIBRARY | ||||
.Lb libc | .Lb libc | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
Show All 12 Lines | |||||
their default values. | their default values. | ||||
The resources include | The resources include | ||||
the open file descriptor table (which, when shared, permits processes | the open file descriptor table (which, when shared, permits processes | ||||
to open and close files for other processes), | to open and close files for other processes), | ||||
and open files. | and open files. | ||||
The | The | ||||
.Fa flags | .Fa flags | ||||
argument | argument | ||||
is the logical OR of some subset of: | is either | ||||
.Dv RFSPAWN | |||||
or the logical OR of some subset of: | |||||
.Bl -tag -width ".Dv RFLINUXTHPN" | .Bl -tag -width ".Dv RFLINUXTHPN" | ||||
.It Dv RFPROC | .It Dv RFPROC | ||||
If set a new process is created; otherwise changes affect the | If set a new process is created; otherwise changes affect the | ||||
current process. | current process. | ||||
.It Dv RFNOWAIT | .It Dv RFNOWAIT | ||||
If set, the child process will be dissociated from the parent. | If set, the child process will be dissociated from the parent. | ||||
Upon | Upon | ||||
exit the child will not leave a status for the parent to collect. | exit the child will not leave a status for the parent to collect. | ||||
▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | |||||
If set, the kernel will deliver SIGUSR1 instead of SIGCHLD upon thread | If set, the kernel will deliver SIGUSR1 instead of SIGCHLD upon thread | ||||
exit for the child. | exit for the child. | ||||
This is intended to mimic certain Linux clone behaviour. | This is intended to mimic certain Linux clone behaviour. | ||||
.El | .El | ||||
.Pp | .Pp | ||||
File descriptors in a shared file descriptor table are kept | File descriptors in a shared file descriptor table are kept | ||||
open until either they are explicitly closed | open until either they are explicitly closed | ||||
or all processes sharing the table exit. | or all processes sharing the table exit. | ||||
.Pp | |||||
If | |||||
.Dv RFSPAWN | |||||
is passed, | |||||
.Nm | |||||
will use | |||||
.Xr vfork 2 | |||||
semantics but reset all signal actions in the child to default. | |||||
kib: 'This is used by .Xr posix_spawn 3 implementation in libc.' | |||||
.Pp | .Pp | ||||
If | If | ||||
.Dv RFPROC | .Dv RFPROC | ||||
is set, the | is set, the | ||||
value returned in the parent process | value returned in the parent process | ||||
is the process id | is the process id | ||||
of the child process; the value returned in the child is zero. | of the child process; the value returned in the child is zero. | ||||
Without | Without | ||||
▲ Show 20 Lines • Show All 79 Lines • Show Last 20 Lines |
'This is used by .Xr posix_spawn 3 implementation in libc.'