ioinit.f should be in the library
[unix-history] / usr / src / usr.bin / f77 / libU77 / fork_.c
CommitLineData
a918866c
DW
1/*
2char id_fork[] = "@(#)fork_.c 1.1";
3 *
4 * fork a copy of this process
5 *
6 * calling sequence:
7 * integer fork
8 * ierror = fork()
9 * where:
10 * ierror will be - child pid if parent and successful
11 * - 0 if child
12 * - -errno if unsuccessful
13 */
14
15#include "../libI77/fiodefs.h"
16
17extern int errno;
18
19long fork_()
20{
21 long i;
22
23 for (i = 0; i < MXUNIT; i++)
24 flush_(&i);
25 i = (long)fork();
26 if (i < 0)
27 return((long)(-errno));
28 return(i);
29}