Detecting exec(2) failing after performing fork(2)?

Stig Jacobsen shj at login.dkuug.dk
Wed Mar 6 03:43:20 AEST 1991


maart at nat.vu.nl (Maarten Litmaath) writes:

>		/* set close-on-exec flag */
>#ifdef	NO_FCNTL
>		ioctl(pp[1], FIOCLEX, (int *) 0);
>#else
>		fcntl(pp[1], F_SETFD, 1);
>#endif	/* NO_FCNTL */
...
>	n = read(pp[0], (char *) &err, sizeof err);
>	close(pp[0]);

>	return n == 0 ? 0 : err;

Yeah! It was something like this that I wanted, where I get no
ugly messages splattering over the parents screen and where I get
an error return from the spawn call and not via some signal. A
big thanks to you and to everybody else who answered here and in
mail.
--
Stig Jacobsen
shj at login.dkuug.dk / sysadm



More information about the Comp.unix.programmer mailing list