]> git.ipfire.org Git - thirdparty/man-pages.git/blame_incremental - man3/posix_spawn.3
fanotify_init.2, fanotify.7: Document FAN_REPORT_TID
[thirdparty/man-pages.git] / man3 / posix_spawn.3
... / ...
CommitLineData
1.\" Copyright (c) 2009 Bill O. Gallmeister (bgallmeister@gmail.com)
2.\" and Copyright 2010 Michael Kerrisk <mtk.manpages@gmail.com>
3.\"
4.\" %%%LICENSE_START(VERBATIM)
5.\" Permission is granted to make and distribute verbatim copies of this
6.\" manual provided the copyright notice and this permission notice are
7.\" preserved on all copies.
8.\"
9.\" Permission is granted to copy and distribute modified versions of this
10.\" manual under the conditions for verbatim copying, provided that the
11.\" entire resulting derived work is distributed under the terms of a
12.\" permission notice identical to this one.
13.\"
14.\" Since the Linux kernel and libraries are constantly changing, this
15.\" manual page may be incorrect or out-of-date. The author(s) assume no
16.\" responsibility for errors or omissions, or for damages resulting from
17.\" the use of the information contained herein. The author(s) may not
18.\" have taken the same level of care in the production of this manual,
19.\" which is licensed free of charge, as they might when working
20.\" professionally.
21.\"
22.\" Formatted or processed versions of this manual, if unaccompanied by
23.\" the source, must acknowledge the copyright and authors of this work.
24.\" %%%LICENSE_END
25.\"
26.\" References consulted:
27.\" Linux glibc source code
28.\" POSIX 1003.1-2004 documentation
29.\" (http://www.opengroup.org/onlinepubs/009695399)
30.\"
31.TH POSIX_SPAWN 3 2017-09-15 "GNU" "Linux Programmer's Manual"
32.SH NAME
33posix_spawn, posix_spawnp \- spawn a process
34.SH SYNOPSIS
35.nf
36.B #include <spawn.h>
37.PP
38.BI "int posix_spawn(pid_t *" pid ", const char *" path ,
39.BI " const posix_spawn_file_actions_t *" file_actions ,
40.BI " const posix_spawnattr_t *" attrp ,
41.BI " char *const " argv[] ", char *const " envp[] );
42.PP
43.BI "int posix_spawnp(pid_t *" pid ", const char *" file ,
44.BI " const posix_spawn_file_actions_t *" file_actions ,
45.BI " const posix_spawnattr_t *" attrp ,
46.BI " char *const " argv[] ", char *const " envp[] );
47.fi
48.SH DESCRIPTION
49The
50.BR posix_spawn ()
51and
52.BR posix_spawnp ()
53functions are used to create a new child process that executes
54a specified file.
55These functions were specified by POSIX to provide a standardized method
56of creating new processes on machines that lack the capability
57to support the
58.BR fork (2)
59system call.
60These machines are generally small, embedded systems lacking MMU support.
61.PP
62The
63.BR posix_spawn ()
64and
65.BR posix_spawnp ()
66functions provide the functionality of a combined
67.BR fork (2)
68and
69.BR exec (3),
70with some optional housekeeping steps in the child process before the
71.BR exec (3).
72These functions are not meant to replace the
73.BR fork (2)
74and
75.BR execve (2)
76system calls.
77In fact, they provide only a subset of the functionality
78that can be achieved by using the system calls.
79.PP
80The only difference between
81.BR posix_spawn ()
82and
83.BR posix_spawnp ()
84is the manner in which they specify the file to be executed by
85the child process.
86With
87.BR posix_spawn (),
88the executable file is specified as a pathname
89(which can be absolute or relative).
90With
91.BR posix_spawnp (),
92the executable file is specified as a simple filename;
93the system searches for this file in the list of directories specified by
94.BR PATH
95(in the same way as for
96.BR execvp (3)).
97For the remainder of this page, the discussion is phrased in terms of
98.BR posix_spawn (),
99with the understanding that
100.BR posix_spawnp ()
101differs only on the point just described.
102.PP
103The remaining arguments to these two functions are as follows:
104.IP * 3
105The
106.I pid
107argument points to a buffer that is used to return the process ID
108of the new child process.
109.IP *
110The
111.I file_actions
112argument points to a
113.I "spawn file actions object"
114that specifies file-related actions to be performed in the child
115between the
116.BR fork (2)
117and
118.BR exec (3)
119steps.
120This object is initialized and populated before the
121.BR posix_spawn ()
122call using
123.BR posix_spawn_file_actions_init (3)
124and the
125.BR posix_spawn_file_actions_* ()
126functions.
127.IP *
128The
129.I attrp
130argument points to an
131.I attributes objects
132that specifies various attributes of the created child process.
133This object is initialized and populated before the
134.BR posix_spawn ()
135call using
136.BR posix_spawnattr_init (3)
137and the
138.BR posix_spawnattr_* ()
139functions.
140.IP *
141The
142.I argv
143and
144.I envp
145arguments specify the argument list and environment for the program
146that is executed in the child process, as for
147.BR execve (2).
148.PP
149Below, the functions are described in terms of a three-step process: the
150.BR fork()
151step, the
152.RB pre- exec ()
153step (executed in the child),
154and the
155.BR exec ()
156step (executed in the child).
157.SS fork() step
158The
159.BR posix_spawn ()
160function commences by calling
161.BR fork (2),
162or possibly
163.BR vfork (2)
164(see below).
165.PP
166The PID of the new child process is placed in
167.IR *pid .
168The
169.BR posix_spawn ()
170function then returns control to the parent process.
171.PP
172Subsequently, the parent can use one of the system calls described in
173.BR wait (2)
174to check the status of the child process.
175If the child fails in any of the housekeeping steps described below,
176or fails to execute the desired file,
177it exits with a status of 127.
178.PP
179The child process is created using
180.BR vfork (2)
181instead of
182.BR fork (2)
183when either of the following is true:
184.IP * 3
185the
186.I spawn-flags
187element of the attributes object pointed to by
188.I attrp
189contains the GNU-specific flag
190.BR POSIX_SPAWN_USEVFORK ;
191or
192.IP *
193.I file_actions
194is NULL and the
195.I spawn-flags
196element of the attributes object pointed to by
197.I attrp
198does \fInot\fP contain
199.BR POSIX_SPAWN_SETSIGMASK ,
200.BR POSIX_SPAWN_SETSIGDEF ,
201.BR POSIX_SPAWN_SETSCHEDPARAM ,
202.BR POSIX_SPAWN_SETSCHEDULER ,
203.BR POSIX_SPAWN_SETPGROUP ,
204or
205.BR POSIX_SPAWN_RESETIDS .
206.PP
207In other words,
208.BR vfork (2)
209is used if the caller requests it,
210or if there is no cleanup expected in the child before it
211.BR exec (3)s
212the requested file.
213.PP
214.SS pre-exec() step: housekeeping
215In between the
216.BR fork (2)
217and the
218.BR exec (3),
219a child process may need to perform a set of housekeeping actions.
220The
221.BR posix_spawn ()
222and
223.BR posix_spawnp ()
224functions support a small, well-defined set of system tasks that the child
225process can accomplish before it executes the executable file.
226These operations are controlled by the attributes object pointed to by
227.IR attrp
228and the file actions object pointed to by
229.IR file_actions .
230In the child, processing is done in the following sequence:
231.IP 1. 3
232Process attribute actions: signal mask, signal default handlers,
233scheduling algorithm and parameters,
234process group, and effective user and group IDs
235are changed as specified by the attributes object pointed to by
236.IR attrp .
237.IP 2.
238File actions, as specified in the
239.I file_actions
240argument,
241are performed in the order that they were specified using calls to the
242.BR posix_spawn_file_actions_add* ()
243functions.
244.IP 3.
245File descriptors with the
246.B FD_CLOEXEC
247flag set are closed.
248.PP
249All process attributes in the child,
250other than those affected by attributes specified in the
251object pointed to by
252.IR attrp
253and the file actions in the object pointed to by
254.IR file_actions ,
255will be affected as though the child was created with
256.BR fork (2)
257and it executed the program with
258.BR execve (2).
259.PP
260The process attributes actions are defined by the attributes object
261pointed to by
262.IR attrp .
263The
264.I spawn-flags
265attribute (set using
266.BR posix_spawnattr_setflags (3))
267controls the general actions that occur,
268and other attributes in the object specify values
269to be used during those actions.
270.PP
271The effects of the flags that may be specified in
272.IR spawn-flags
273are as follows:
274.TP 8
275.B POSIX_SPAWN_SETSIGMASK
276Set the signal mask to the signal set specified in the
277.I spawn-sigmask
278attribute
279.\" FIXME .
280.\" (see
281.\" .BR posix_spawnattr_setsigmask (3))
282of the object pointed to by
283.IR attrp .
284If the
285.B POSIX_SPAWN_SETSIGMASK
286flag is not set, then the child inherits the parent's signal mask.
287.TP
288.B POSIX_SPAWN_SETSIGDEF
289Reset the disposition of all signals in the set specified in the
290.I spawn-sigdefault
291attribute
292.\" FIXME .
293.\" (see
294.\" .BR posix_spawnattr_setsigdefault (3))
295of the object pointed to by
296.IR attrp
297to the default.
298For the treatment of the dispositions of signals not specified in the
299.I spawn-sigdefault
300attribute, or the treatment when
301.B POSIX_SPAWN_SETSIGDEF
302is not specified, see
303.BR execve (2).
304.TP
305.B POSIX_SPAWN_SETSCHEDPARAM
306.\" (POSIX_PRIORITY_SCHEDULING only)
307If this flag is set, and the
308.B POSIX_SPAWN_SETSCHEDULER
309flag is not set, then set the scheduling parameters
310to the parameters specified in the
311.I spawn-schedparam
312attribute
313.\" FIXME .
314.\" (see
315.\" .BR posix_spawnattr_setschedparam (3))
316of the object pointed to by
317.IR attrp .
318.TP
319.B POSIX_SPAWN_SETSCHEDULER
320Set the scheduling policy algorithm and parameters of the child,
321as follows:
322.RS
323.IP * 3
324The scheduling policy is set to the value specified in the
325.I spawn-schedpolicy
326attribute
327.\" FIXME .
328.\" (see
329.\" .BR posix_spawnattr_setpolicy (3))
330of the object pointed to by
331.IR attrp .
332.IP *
333The scheduling parameters are set to the value specified in the
334.I spawn-schedparam
335attribute
336.\" FIXME .
337.\" (see
338.\" .BR posix_spawnattr_setschedparam (3))
339of the object pointed to by
340.IR attrp
341(but see BUGS).
342.PP
343If the
344.B POSIX_SPAWN_SETSCHEDPARAM
345and
346.B POSIX_SPAWN_SETSCHEDPOLICY
347flags are not specified,
348the child inherits the corresponding scheduling attributes from the parent.
349.RE
350.TP
351.B POSIX_SPAWN_RESETIDS
352If this flag is set,
353reset the effective UID and GID to the
354real UID and GID of the parent process.
355If this flag is not set,
356then the child retains the effective UID and GID of the parent.
357In either case, if the set-user-ID and set-group-ID permission
358bits are enabled on the executable file, their effect will override
359the setting of the effective UID and GID (se
360.BR execve (2)).
361.TP
362.B POSIX_SPAWN_SETPGROUP
363Set the process group to the value specified in the
364.I spawn-pgroup
365attribute
366.\" FIXME .
367.\" (see
368.\" .BR posix_spawnattr_setpgroup (3))
369of the object pointed to by
370.IR attrp .
371If the
372.I spawn-pgroup
373attribute has the value 0,
374the child's process group ID is made the same as its process ID.
375If the
376.B POSIX_SPAWN_SETPGROUP
377flag is not set, the child inherits the parent's process group ID.
378.PP
379If
380.I attrp
381is NULL, then the default behaviors described above for each flag apply.
382.\" mtk: I think we probably don't want to say the following, since it
383.\" could lead people to do the wrong thing
384.\" The POSIX standard tells you to call
385.\" this function to de-initialize the attributes object pointed to by
386.\" .I attrp
387.\" when you are done with it;
388.\" however, on Linux systems this operation is a no-op.
389.PP
390The
391.I file_actions
392argument specifies a sequence of file operations
393that are performed in the child process after
394the general processing described above, and before it performs the
395.BR exec (3).
396If
397.I file_actions
398is NULL, then no special action is taken, and standard
399.BR exec (3)
400semantics apply--file descriptors open before the exec
401remain open in the new process,
402except those for which the
403.B FD_CLOEXEC
404flag has been set.
405File locks remain in place.
406.PP
407If
408.I file_actions
409is not NULL, then it contains an ordered set of requests to
410.BR open (2),
411.BR close (2),
412and
413.BR dup2 (2)
414files.
415These requests are added to the
416.I file_actions
417by
418.BR posix_spawn_file_actions_addopen (3),
419.BR posix_spawn_file_actions_addclose (3),
420and
421.BR posix_spawn_file_actions_adddup2 (3).
422The requested operations are performed in the order they were added to
423.IR file_actions .
424.\" FIXME . I think the following is best placed in the
425.\" posix_spawn_file_actions_adddup2(3) page, and a similar statement is
426.\" also needed in posix_spawn_file_actions_addclose(3)
427.\" Note that you can specify file descriptors in
428.\" .I posix_spawn_file_actions_adddup2 (3)
429.\" which would not be usable if you called
430.\" .BR dup2 (2)
431.\" at that time--i.e., file descriptors that are opened or
432.\" closed by the earlier operations
433.\" added to
434.\" .I file_actions .
435.PP
436If any of the housekeeping actions fails
437(due to bogus values being passed or other reasons why signal handling,
438process scheduling, process group ID functions,
439and file descriptor operations might fail),
440the child process exits with exit value 127.
441.SS exec() step
442Once the child has successfully forked and performed
443all requested pre-exec steps,
444the child runs the requested executable.
445.PP
446The child process takes its environment from the
447.I envp
448argument, which is interpreted as if it had been passed to
449.BR execve (2).
450The arguments to the created process come from the
451.I argv
452argument, which is processed as for
453.BR execve (2).
454.SH RETURN VALUE
455Upon successful completion,
456.BR posix_spawn ()
457and
458.BR posix_spawnp ()
459place the PID of the child process in
460.IR pid ,
461and return 0.
462If there is an error before or during the
463.BR fork (2),
464then no child is created,
465the contents of
466.IR *pid
467are unspecified,
468and these functions return an error number as described below.
469.PP
470Even when these functions return a success status,
471the child process may still fail for a plethora of reasons related to its
472pre-\fBexec\fR() initialization.
473In addition, the
474.BR exec (3)
475may fail.
476In all of these cases, the child process will exit with the exit value of 127.
477.SH ERRORS
478The
479.BR posix_spawn ()
480and
481.BR posix_spawnp ()
482functions fail only in the case where the underlying
483.BR fork (2)
484or
485.BR vfork (2)
486call fails; in these cases, these functions return an error number,
487which will be one of the errors described for
488.BR fork (2)
489or
490.BR vfork (2).
491.PP
492In addition, these functions fail if:
493.TP
494.B ENOSYS
495Function not supported on this system.
496.SH VERSIONS
497The
498.BR posix_spawn ()
499and
500.BR posix_spawnp ()
501functions are available since glibc 2.2.
502.SH CONFORMING TO
503.PP
504POSIX.1-2001, POSIX.1-2008.
505.\" FIXME . This piece belongs in spawnattr_setflags(3)
506.\" The
507.\" .B POSIX_SPAWN_USEVFORK
508.\" flag is a GNU extension; the
509.\" .B _GNU_SOURCE
510.\" feature test macro must be defined (before including any header files)
511.\" to obtain the definition of this constant.
512.SH NOTES
513The housekeeping activities in the child are controlled by
514the objects pointed to by
515.I attrp
516(for non-file actions) and
517.I file_actions
518In POSIX parlance, the
519.I posix_spawnattr_t
520and
521.I posix_spawn_file_actions_t
522data types are referred to as objects,
523and their elements are not specified by name.
524Portable programs should initialize these objects using
525only the POSIX-specified functions.
526(In other words,
527although these objects may be implemented as structures containing fields,
528portable programs must avoid dependence on such implementation details.)
529.PP
530According to POSIX, it unspecified whether fork handlers established with
531.BR pthread_atfork (3)
532are called when
533.BR posix_spawn ()
534is invoked.
535On glibc,
536.\" Tested on glibc 2.12
537fork handlers are called only if the child is created using
538.BR fork (2).
539.PP
540There is no "posix_fspawn" function (i.e., a function that is to
541.BR posix_spawn ()
542as
543.BR fexecve (3)
544is to
545.BR execve (2)).
546However, this functionality can be obtained by specifying the
547.I path
548argument as one of the files in the caller's
549.IR /proc/self/fd
550directory.
551.SH BUGS
552POSIX.1 says that when
553.B POSIX_SPAWN_SETSCHEDULER
554is specified in
555.IR spawn-flags ,
556then the
557.B POSIX_SPAWN_SETSCHEDPARAM
558(if present) is ignored.
559However, before glibc 2.14, calls to
560.BR posix_spawn ()
561failed with an error if
562.\" http://sourceware.org/bugzilla/show_bug.cgi?id=12052
563.BR POSIX_SPAWN_SETSCHEDULER
564was specified without also specifying
565.BR POSIX_SPAWN_SETSCHEDPARAM .
566.SH EXAMPLE
567The program below demonstrates the use of various functions in the
568POSIX spawn API.
569The program accepts command-line attributes that can be used
570to create file actions and attributes objects.
571The remaining command-line arguments are used as the executable name
572and command-line arguments of the program that is executed in the child.
573.PP
574In the first run, the
575.BR date (1)
576command is executed in the child, and the
577.BR posix_spawn ()
578call employs no file actions or attributes objects.
579.PP
580.in +4
581.EX
582$ \fB./a.out date\fP
583PID of child: 7634
584Tue Feb 1 19:47:50 CEST 2011
585Child status: exited, status=0
586.EE
587.in
588.PP
589In the next run, the
590.I \-c
591command-line option is used to create a file actions object that closes
592standard output in the child.
593Consequently,
594.BR date (1)
595fails when trying to perform output and exits with a status of 1.
596.PP
597.in +4
598.EX
599$ \fB./a.out -c date\fP
600PID of child: 7636
601date: write error: Bad file descriptor
602Child status: exited, status=1
603.EE
604.in
605.PP
606In the next run, the
607.I \-s
608command-line option is used to create an attributes object that
609specifies that all (blockable) signals in the child should be blocked.
610Consequently, trying to kill child with the default signal sent by
611.BR kill (1)
612(i.e.,
613.BR SIGTERM )
614fails, because that signal is blocked.
615Therefore, to kill the child,
616.BR SIGKILL
617is necessary
618.RB ( SIGKILL
619can't be blocked).
620.PP
621.in +4
622.EX
623$ \fB./a.out -s sleep 60 &\fP
624[1] 7637
625$ PID of child: 7638
626
627$ \fBkill 7638\fP
628$ \fBkill -KILL 7638\fP
629$ Child status: killed by signal 9
630[1]+ Done ./a.out -s sleep 60
631.EE
632.in
633.PP
634When we try to execute a nonexistent command in the child, the
635.BR exec (3)
636fails and the child exits with a status of 127.
637.PP
638.in +4
639.EX
640$ \fB./a.out xxxxx
641PID of child: 10190
642Child status: exited, status=127
643.EE
644.in
645.SS Program source
646\&
647.EX
648#include <spawn.h>
649#include <stdio.h>
650#include <unistd.h>
651#include <stdlib.h>
652#include <string.h>
653#include <wait.h>
654#include <errno.h>
655
656#define errExit(msg) do { perror(msg); \\
657 exit(EXIT_FAILURE); } while (0)
658
659#define errExitEN(en, msg) \\
660 do { errno = en; perror(msg); \\
661 exit(EXIT_FAILURE); } while (0)
662
663char **environ;
664
665int
666main(int argc, char *argv[])
667{
668 pid_t child_pid;
669 int s, opt, status;
670 sigset_t mask;
671 posix_spawnattr_t attr;
672 posix_spawnattr_t *attrp;
673 posix_spawn_file_actions_t file_actions;
674 posix_spawn_file_actions_t *file_actionsp;
675
676 /* Parse command\-line options, which can be used to specify an
677 attributes object and file actions object for the child. */
678
679 attrp = NULL;
680 file_actionsp = NULL;
681
682 while ((opt = getopt(argc, argv, "sc")) != \-1) {
683 switch (opt) {
684 case \(aqc\(aq: /* \-c: close standard output in child */
685
686 /* Create a file actions object and add a "close"
687 action to it */
688
689 s = posix_spawn_file_actions_init(&file_actions);
690 if (s != 0)
691 errExitEN(s, "posix_spawn_file_actions_init");
692
693 s = posix_spawn_file_actions_addclose(&file_actions,
694 STDOUT_FILENO);
695 if (s != 0)
696 errExitEN(s, "posix_spawn_file_actions_addclose");
697
698 file_actionsp = &file_actions;
699 break;
700
701 case \(aqs\(aq: /* \-s: block all signals in child */
702
703 /* Create an attributes object and add a "set signal mask"
704 action to it */
705
706 s = posix_spawnattr_init(&attr);
707 if (s != 0)
708 errExitEN(s, "posix_spawnattr_init");
709 s = posix_spawnattr_setflags(&attr, POSIX_SPAWN_SETSIGMASK);
710 if (s != 0)
711 errExitEN(s, "posix_spawnattr_setflags");
712
713 sigfillset(&mask);
714 s = posix_spawnattr_setsigmask(&attr, &mask);
715 if (s != 0)
716 errExitEN(s, "posix_spawnattr_setsigmask");
717
718 attrp = &attr;
719 break;
720 }
721 }
722
723 /* Spawn the child. The name of the program to execute and the
724 command\-line arguments are taken from the command\-line arguments
725 of this program. The environment of the program execed in the
726 child is made the same as the parent\(aqs environment. */
727
728 s = posix_spawnp(&child_pid, argv[optind], file_actionsp, attrp,
729 &argv[optind], environ);
730 if (s != 0)
731 errExitEN(s, "posix_spawn");
732
733 /* Destroy any objects that we created earlier */
734
735 if (attrp != NULL) {
736 s = posix_spawnattr_destroy(attrp);
737 if (s != 0)
738 errExitEN(s, "posix_spawnattr_destroy");
739 }
740
741 if (file_actionsp != NULL) {
742 s = posix_spawn_file_actions_destroy(file_actionsp);
743 if (s != 0)
744 errExitEN(s, "posix_spawn_file_actions_destroy");
745 }
746
747 printf("PID of child: %ld\\n", (long) child_pid);
748
749 /* Monitor status of the child until it terminates */
750
751 do {
752 s = waitpid(child_pid, &status, WUNTRACED | WCONTINUED);
753 if (s == \-1)
754 errExit("waitpid");
755
756 printf("Child status: ");
757 if (WIFEXITED(status)) {
758 printf("exited, status=%d\\n", WEXITSTATUS(status));
759 } else if (WIFSIGNALED(status)) {
760 printf("killed by signal %d\\n", WTERMSIG(status));
761 } else if (WIFSTOPPED(status)) {
762 printf("stopped by signal %d\\n", WSTOPSIG(status));
763 } else if (WIFCONTINUED(status)) {
764 printf("continued\\n");
765 }
766 } while (!WIFEXITED(status) && !WIFSIGNALED(status));
767
768 exit(EXIT_SUCCESS);
769}
770.EE
771.SH SEE ALSO
772.nh \" Disable hyphenation
773.ad l
774.BR close (2),
775.BR dup2 (2),
776.BR execl (2),
777.BR execlp (2),
778.BR fork (2),
779.BR open (2),
780.BR sched_setparam (2),
781.BR sched_setscheduler (2),
782.BR setpgid (2),
783.BR setuid (2),
784.BR sigaction (2),
785.BR sigprocmask (2),
786.BR posix_spawn_file_actions_addclose (3),
787.BR posix_spawn_file_actions_adddup2 (3),
788.BR posix_spawn_file_actions_addopen (3),
789.BR posix_spawn_file_actions_destroy (3),
790.BR posix_spawn_file_actions_init (3),
791.BR posix_spawnattr_destroy (3),
792.BR posix_spawnattr_getflags (3),
793.BR posix_spawnattr_getpgroup (3),
794.BR posix_spawnattr_getschedparam (3),
795.BR posix_spawnattr_getschedpolicy (3),
796.BR posix_spawnattr_getsigdefault (3),
797.BR posix_spawnattr_getsigmask (3),
798.BR posix_spawnattr_init (3),
799.BR posix_spawnattr_setflags (3),
800.BR posix_spawnattr_setpgroup (3),
801.BR posix_spawnattr_setschedparam (3),
802.BR posix_spawnattr_setschedpolicy (3),
803.BR posix_spawnattr_setsigdefault (3),
804.BR posix_spawnattr_setsigmask (3),
805.BR pthread_atfork (3),
806.BR <spawn.h>,
807Base Definitions volume of POSIX.1-2001,
808.I http://www.opengroup.org/unix/online.html