GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
RFORK(3) FreeBSD Library Functions Manual RFORK(3)

rfork - manipulate process state

#include <u.h>
#include <libc.h>

int rfork(int flags)

Rfork is a partial implementation of the Plan 9 system call. It can be used to manipulate some process state and to create new processes a la It cannot be used to create shared-memory processes (Plan 9's RFMEM flag); for that functionality use proccreate (see

The flags argument to rfork selects which resources of the invoking process (parent) are shared by the new process (child) or initialized to their default values. Flags is the logical OR of some subset of

RFPROC
If set a new process is created; otherwise changes affect the current process.
RFNOWAIT
If set, the child process will be dissociated from the parent. Upon exit the child will leave no Waitmsg (see for the parent to collect.
RFNOTEG
Each process is a member of a group of processes that all receive notes when a note is sent to the group (see and The group of a new process is by default the same as its parent, but if RFNOTEG is set (regardless of RFPROC), the process becomes the first in a new group, isolated from previous processes. In Plan 9, a process can call rfork(RFNOTEG) and then be sure that it will no longer receive console interrupts or other notes. Unix job-control shells put each command in its own process group and then relay notes to the current foreground command, making the idiom less useful.
RFFDG
If set, the invoker's file descriptor table (see intro()) is copied; otherwise the two processes share a single table.

File descriptors in a shared file descriptor table are kept open until either they are explicitly closed or all processes sharing the table exit.

If RFPROC is set, the value returned in the parent process is the process id of the child process; the value returned in the child is zero. Without RFPROC, the return value is zero. Process ids range from 1 to the maximum integer (int) value. Rfork will sleep, if necessary, until required process resources are available.

Calling rfork(RFFDG|RFPROC) is equivalent to calling

/src/lib9/rfork.c

Rfork sets errstr.

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.