Subject: pipe(2) and invalid fildes
To: None <tech-kern@netbsd.org>
From: Jaromír <jdolecek@netbsd.org>
List: tech-kern
Date: 09/29/2001 21:41:35
Hi,
I've noticed ages old kern/7720. The issue there is that pipe(2) with
invalid pointer to the descriptor array should return EFAULT according
to our manpage, but it dies with SIGSEGV or SIGBUS.
The test program:

int  
main()
{
	pipe(0xdeadbeaf);
	perror("pipe");
}

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.

Thoughs? I'd like to update the manpage and remove the EFAULT
from errors, and close the PR.

Jaromir
-- 
Jaromir Dolecek <jdolecek@NetBSD.org>      http://www.ics.muni.cz/~dolecek/
NetBSD - just plain best OS! -=*=- Got spare MCA cards or docs? Hand me them!