Subject: Re: /bin/sh "Cannot vfork" behaviour
To: Alan Barrett <email@example.com>
From: David Laight <firstname.lastname@example.org>
Date: 10/28/2003 18:20:28
On Mon, Oct 27, 2003 at 11:14:25AM +0200, Alan Barrett wrote:
> What is the following command supposed to do if the maxproc limit is
> $ /bin/sh -c "set -x ; ulimit -p 1 ; date || exit 75" ; \
> echo status=$?
> + ulimit -p 1
> + date
> Cannot vfork
> Is it a bug that the exit status is 2 rather than 75?
Posix doesn't explicitely mention fork failing :-(
There is the table:
Which has 'May Exit' for 'Command not found'.
I suspect that 'Exit' for 'fork failed' is ok.
I suspect the 'exit' is the traditional behaviour for fork failing in a
A traditional bourne shell (and pdksh) will sleep and retry the fork,
NetBSD's /bin/sh doesn't.
David Laight: email@example.com