]> sourceware.org Git - glibc.git/blame - posix/test-vfork.c
Update.
[glibc.git] / posix / test-vfork.c
CommitLineData
d0ab7780
UD
1#include <stdio.h>
2#include <unistd.h>
3#include <error.h>
4#include <errno.h>
464d646f 5#include <sys/wait.h>
d0ab7780
UD
6
7void noop (void);
8
9int
10main (void)
11{
12 int pid;
13
14 printf ("Before vfork\n");
15 fflush (stdout);
16 pid = vfork ();
17 if (pid == 0)
18 {
19 /* This will clobber the return pc from vfork in the parent on
20 machines where it is stored on the stack, if vfork wasn't
21 implemented correctly, */
22 noop ();
23 _exit (2);
24 }
25 else if (pid < 0)
26 error (1, errno, "vfork");
27 printf ("After vfork (parent)\n");
28 wait (0);
29 exit (0);
30}
31
32void
33noop ()
34{
35}
This page took 0.027338 seconds and 5 git commands to generate.