001
25.04.2004, 21:36 Uhr
Pablo
Supertux (Operator)
|
Vergleich zwischen Linux und Solaris
linux
man fork: |
NAME fork - create a child process
SYNOPSIS #include <sys/types.h> #include <unistd.h>
pid_t fork(void);
DESCRIPTION fork creates a child process that differs from the parent process only in its PID and PPID, and in the fact that resource utilizations are set to 0. File locks and pending signals are not inherited.
Under Linux, fork is implemented using copy-on-write pages, so the only penalty incurred by fork is the time and memory required to duplicate the parent's page tables, and to create a unique task structure for the child.
RETURN VALUE On success, the PID of the child process is returned in the parent's thread of execution, and a 0 is returned in the child's thread of execution. On failure, a -1 will be returned in the parent's con- text, no child process will be created, and errno will be set appropriately.
ERRORS EAGAIN fork cannot allocate sufficient memory to copy the parent's page tables and allocate a task structure for the child.
ENOMEM fork failed to allocate the necessary kernel structures because memory is tight.
CONFORMING TO The fork call conforms to SVr4, SVID, POSIX, X/OPEN, BSD 4.3.
SEE ALSO clone(2), execve(2), vfork(2), wait(2)
Linux 1.2.9 1995-06-10 FORK(2)
|
solaris
man fork: |
System Calls fork(2)
NAME fork, fork1 - create a new process
SYNOPSIS #include <sys/types.h> #include <unistd.h>
pid_t fork(void);
pid_t fork1(void);
DESCRIPTION The fork() and fork1() functions create a new process. The new process (child process) is an exact copy of the calling process (parent process). The child process inherits the following attributes from the parent process:
o real user ID, real group ID, effective user ID, effec- tive group ID
o environment
o open file descriptors
o close-on-exec flags (see exec(2))
o signal handling settings (that is, SIG_DFL, SIG_IGN, SIG_HOLD, function address)
o supplementary group IDs
o set-user-ID mode bit
o set-group-ID mode bit
o profiling on/off status
o nice value (see nice(2)) ...
|
Scheint unterschiedlich zu sein. Mit Solaris habe ich schon einige Probleme gehabt, wenn ich meine in linux geschriebene Programme kompilieren will. -- A! Elbereth Gilthoniel! silivren penna míriel o menel aglar elenath, Gilthoniel, A! Elbereth! |