|
NAMEvfork —
create a new process without copying the address space
LIBRARYStandard C Library (libc, -lc)SYNOPSIS#include <unistd.h>
pid_t
DESCRIPTIONSince this function is hard to use correctly from application
software, it is recommended to use
posix_spawn(3)
or fork(2)
instead.
The The Many problems can occur when replacing
fork(2)
with Be careful, also, to call _exit(2) rather than exit(3) if you cannot execve(2), since exit(3) will flush and close standard I/O channels, and thereby mess up the parent processes standard I/O data structures. (Even with fork(2) it is wrong to call exit(3) since buffered data would then be flushed twice.) RETURN VALUESSame as for fork(2).SEE ALSO_exit(2), execve(2), fork(2), rfork(2), sigaction(2), wait(2), exit(3), posix_spawn(3)HISTORYThevfork () system call appeared in
3BSD.
BUGSTo avoid a possible deadlock situation, processes that are children in the middle of avfork () are never sent
SIGTTOU or SIGTTIN signals;
rather, output or
ioctl(2)
calls are allowed and input attempts result in an end-of-file indication.
Visit the GSP FreeBSD Man Page Interface. |