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


Manual Reference Pages  -  RFORK (3)

NAME

rfork - manipulate process state

CONTENTS

Synopsis
Description
Source
Diagnostics

SYNOPSIS

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


 
int rfork(int flags)

DESCRIPTION

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 fork(2). It cannot be used to create shared-memory processes (Plan 9’s RFMEM flag); for that functionality use proccreate (see thread(3)).

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 wait(3)) 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 postnote(3) and signal(2)). 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 fork(2).

SOURCE

/usr/local/plan9/src/lib9/rfork.c

DIAGNOSTICS

Rfork sets errstr.
Search for    or go to Top of page |  Section 3 |  Main Index


RFORK (3) -->

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