1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2000 Silicon Graphics, Inc.
9 #define FORKER_MAX_PIDS 4098
11 extern int Forker_pids[FORKER_MAX_PIDS]; /* holds pids of forked processes */
12 extern int Forker_npids; /* number of entries in Forker_pids */
15 * This function will fork and the parent will exit zero and
16 * the child will return. This will orphan the returning process
17 * putting it in the background.
19 int background( char * );
22 * Forker will fork ncopies-1 copies of self.
24 * arg 1: Number of copies of the process to be running after return.
25 * This value minus one is the number of forks performed.
26 * arg 2: mode: 0 - all children are first generation descendents.
27 * 1 - each subsequent child is a descendent of another
28 * descendent, resulting in only one direct descendent of the
29 * parent and each other child is a child of another child in
30 * relation to the parent.
31 * arg 3: prefix: string to preceed any error messages. A value of NULL
32 * results in no error messages on failure.
33 * returns: returns to parent the number of children forked.
35 int forker( int , int , char * );
37 #endif /* _FORKER_H_ */