2 * Copyright (c) 2000 Silicon Graphics, Inc.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 #define FORKER_MAX_PIDS 4098
23 extern int Forker_pids[FORKER_MAX_PIDS]; /* holds pids of forked processes */
24 extern int Forker_npids; /* number of entries in Forker_pids */
27 * This function will fork and the parent will exit zero and
28 * the child will return. This will orphan the returning process
29 * putting it in the background.
31 int background( char * );
34 * Forker will fork ncopies-1 copies of self.
36 * arg 1: Number of copies of the process to be running after return.
37 * This value minus one is the number of forks performed.
38 * arg 2: mode: 0 - all children are first generation descendents.
39 * 1 - each subsequent child is a descendent of another
40 * descendent, resulting in only one direct descendent of the
41 * parent and each other child is a child of another child in
42 * relation to the parent.
43 * arg 3: prefix: string to preceed any error messages. A value of NULL
44 * results in no error messages on failure.
45 * returns: returns to parent the number of children forked.
47 int forker( int , int , char * );
49 #endif /* _FORKER_H_ */