mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-28 20:23:35 +08:00
464d646f3e
1999-01-18 Andreas Jaeger <aj@arthur.rhein-neckar.de> * posix/test-vfork.c: Include <sys/wait.h> for wait declaration. 1999-01-16 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> * manual/ctype.texi: Fix cross refs and typos. * manual/charset.texi: Likewise. 1999-01-18 Ulrich Drepper <drepper@cygnus.com> * Rules: Add dummp.y and dummy.o to common-generated. Patch by Andreas Schwab. 1999-01-18 10:07 -0500 Zack Weinberg <zack@rabi.phys.columbia.edu> * manual/libc-texinfo.sh: Use tsort.awk. * manual/tsort.awk: New file. * manual/Makefile (minimal-dist): Add tsort.awk. (distribute): Remove generated files: summary.texi, stamp-summary, chapters.texi, top-menu.texi, and texis.
36 lines
564 B
C
36 lines
564 B
C
#include <stdio.h>
|
|
#include <unistd.h>
|
|
#include <error.h>
|
|
#include <errno.h>
|
|
#include <sys/wait.h>
|
|
|
|
void noop (void);
|
|
|
|
int
|
|
main (void)
|
|
{
|
|
int pid;
|
|
|
|
printf ("Before vfork\n");
|
|
fflush (stdout);
|
|
pid = vfork ();
|
|
if (pid == 0)
|
|
{
|
|
/* This will clobber the return pc from vfork in the parent on
|
|
machines where it is stored on the stack, if vfork wasn't
|
|
implemented correctly, */
|
|
noop ();
|
|
_exit (2);
|
|
}
|
|
else if (pid < 0)
|
|
error (1, errno, "vfork");
|
|
printf ("After vfork (parent)\n");
|
|
wait (0);
|
|
exit (0);
|
|
}
|
|
|
|
void
|
|
noop ()
|
|
{
|
|
}
|