Dr. Debasish Jana
Dr. Debasish Jana

Reputation: 7118

Linux equivalent of fork1 of solaris

Is there any Linux equivalent of fork1 of Solaris? The Solaris man pages say: A call to fork() is identical to a call to fork1(); only the calling thread is replicated in the child process. This is the POSIX-specified behavior for fork().

Upvotes: 0

Views: 260

Answers (1)

Andrew Henle
Andrew Henle

Reputation: 1

Per the Linux fork() man page:

...

Note the following further points:

  • The child process is created with a single thread—the one that called fork(). The entire virtual address space of the parent is replicated in the child, including the states of mutexes, condition variables, and other pthreads objects; the use of pthread_atfork(3) may be helpful for dealing with problems that this can cause.

...

Since both fork() and fork1() on Solaris replicate only the calling thread in the child process, the Linux fork() call would be the equivalent.

Upvotes: 1

Related Questions