vfork() (was Re: RS6000 questions/comments)

Theo de Raadt deraadt at cpsc.ucalgary.ca
Sat Jun 29 02:57:58 AEST 1991


In article <1991Jun29.072930.24674 at kithrup.COM> sef at kithrup.COM (Sean Eric Fagan) writes:
>>Also, don't forget to use _exit() (note the leading underscore '_') INSTEAD
>>of exit() in the event the execve() fails so that you don't hose the parent's
>>stdio.
>Yep.  That's what happens when you use the hack vfork().

Sean, I'm disapointed in you.

% cat > test.c
#include <stdio.h>
main()
{
	printf("hello ");
	switch(fork()) {
	case 0:
		printf("world\n");
		exit(0);
	case -1:
		perror("fork");
		exit(1);
	default:
		exit(0);
	}
}
% cc test.c -o test
% ./test
hello % hello world
./test
hello world
hello %

That's the way that stdio works.
 <tdr.
--

SunOS 4.1.1: /usr/include/vm/as.h, Line 49    | Theo de Raadt
typo? Should the '_'  be an 's'??             | deraadt at cpsc.ucalgary.ca



More information about the Comp.unix.aix mailing list