Subject: Re: pipe(2) and invalid fildes
To: =?iso-8859-1?q?Jarom=EDr?= <jdolecek@netbsd.org>
From: Perry E. Metzger <perry@wasabisystems.com>
List: tech-kern
Date: 09/29/2001 16:35:06
"Jarom=EDr" Dolecek <jdolecek@netbsd.org> writes:
> SUSv2 manpage doesn't even note EFAULT in ERRORS, not mention
> anything in the pipe(2) manpage text. So, it seems NetBSD behaviour
> is standards-conforming and thus correct. At least to the extend
> that it's permitted to either crash or return EFAULT, and no from
> these two is necessarily more correct that other.
>=20
> Thoughs? I'd like to update the manpage and remove the EFAULT
> from errors, and close the PR.

This seems highly wrong.

SuS states a minimum set of behaviors, not all the behaviors that an
implementation may have. It is perfectly fine for an implementation to
catch more errors than SuSv2 specifies, and indeed, removing error
handling capability seems wrong. In particular, I think that it is
reasonable for pipe() to detect that it has been passed an invalid
pointer and do something reasonable instead of crashing.

Perry
--
Perry E. Metzger		perry@wasabisystems.com
--
NetBSD Development, Support & CDs. http://www.wasabisystems.com/