mirror of git://sourceware.org/git/glibc.git
Update.
* posix/Makefile (tests): Add test-vfork. * posix/test-vfork.c: New file by Andreas Schwab.
This commit is contained in:
parent
a58fe83962
commit
d0ab77802a
|
|
@ -1,5 +1,8 @@
|
||||||
1999-01-15 Ulrich Drepper <drepper@cygnus.com>
|
1999-01-15 Ulrich Drepper <drepper@cygnus.com>
|
||||||
|
|
||||||
|
* posix/Makefile (tests): Add test-vfork.
|
||||||
|
* posix/test-vfork.c: New file by Andreas Schwab.
|
||||||
|
|
||||||
* manual/charset.texi: More misspelling fixes.
|
* manual/charset.texi: More misspelling fixes.
|
||||||
Reported by Tom Tromey <tromey@cygnus.com>.
|
Reported by Tom Tromey <tromey@cygnus.com>.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
|
# Copyright (C) 1991,92,93,94,95,96,97,98,99 Free Software Foundation, Inc.
|
||||||
# This file is part of the GNU C Library.
|
# This file is part of the GNU C Library.
|
||||||
|
|
||||||
# The GNU C Library is free software; you can redistribute it and/or
|
# The GNU C Library is free software; you can redistribute it and/or
|
||||||
|
|
@ -56,7 +56,7 @@ include ../Makeconfig
|
||||||
|
|
||||||
aux := init-posix environ
|
aux := init-posix environ
|
||||||
tests := tstgetopt testfnm runtests wordexp-test runptests \
|
tests := tstgetopt testfnm runtests wordexp-test runptests \
|
||||||
tst-preadwrite
|
tst-preadwrite test-vfork
|
||||||
test-srcs := globtest
|
test-srcs := globtest
|
||||||
others := getconf
|
others := getconf
|
||||||
install-bin := getconf
|
install-bin := getconf
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <error.h>
|
||||||
|
#include <errno.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 ()
|
||||||
|
{
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue