From d0ab77802ac748c07d7302aa728ad063ce98309f Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 15 Jan 1999 13:35:35 +0000 Subject: Update. * posix/Makefile (tests): Add test-vfork. * posix/test-vfork.c: New file by Andreas Schwab. --- ChangeLog | 3 +++ posix/Makefile | 4 ++-- posix/test-vfork.c | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 posix/test-vfork.c diff --git a/ChangeLog b/ChangeLog index 97d83c1..db0ef90 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 1999-01-15 Ulrich Drepper + * posix/Makefile (tests): Add test-vfork. + * posix/test-vfork.c: New file by Andreas Schwab. + * manual/charset.texi: More misspelling fixes. Reported by Tom Tromey . diff --git a/posix/Makefile b/posix/Makefile index ff185dc..b39abcd 100644 --- a/posix/Makefile +++ b/posix/Makefile @@ -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. # The GNU C Library is free software; you can redistribute it and/or @@ -56,7 +56,7 @@ include ../Makeconfig aux := init-posix environ tests := tstgetopt testfnm runtests wordexp-test runptests \ - tst-preadwrite + tst-preadwrite test-vfork test-srcs := globtest others := getconf install-bin := getconf diff --git a/posix/test-vfork.c b/posix/test-vfork.c new file mode 100644 index 0000000..60abe0b --- /dev/null +++ b/posix/test-vfork.c @@ -0,0 +1,34 @@ +#include +#include +#include +#include + +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 () +{ +} -- cgit v1.1