home *** CD-ROM | disk | FTP | other *** search
-
-
-
- FORK(3) MINTLIB LIBRARY FUNCTIONS FORK(3)
-
-
- N✓NA✓AM✓ME✓E
- fork - create a new process
-
- S✓SY✓YN✓NO✓OP✓PS✓SI✓IS✓S
- #include <unistd.h>
-
- int fork(void);
-
- D✓DE✓ES✓SC✓CR✓RI✓IP✓PT✓TI✓IO✓ON✓N
- fork creates a copy of the current process using Pfork.
- This call splits the program into two copies, both of
- which continue to run. The only difference between the two
- is the returned value. In one of these processes, the
- child, this is zero. In the other, the parent, it is non-
- zero; it is the process ID of the child (a positive num-
- ber), or a negative error code if the call failed.
-
- S✓SE✓EE✓E A✓AL✓LS✓SO✓O
- e✓ex✓xe✓ec✓c.✓..✓.(✓(3✓3)✓),✓, t✓tf✓fo✓or✓rk✓k(✓(3✓3)✓),✓, v✓vf✓fo✓or✓rk✓k(✓(3✓3)✓),✓, w✓wa✓ai✓it✓t(✓(3✓3)✓)
-
- N✓NO✓OT✓TE✓ES✓S
- At the moment (MiNT 0.99 and earlier), Pfork, and conse-
- quently also fork, suspends the parent until the child has
- terminated or overlays itself. This has yet to be fixed,
- and may cause problems when porting UN*X programs.
-
- There are various intricate differences between the parent
- and the child process, like the effects of closing a file
- on which a lock has been obtained (the parent owns the
- locks). You are advised to check the man pages for Pfork
- and Pvfork, in addition to the kernel sources, if you
- really want to know.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MiNT docs 0.1 3 March 1993 1
-
-
-