[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: rfc: fcntl() error reporting
On Fri, Aug 22, 2008 at 04:45:33PM +0300, Andy Shevchenko wrote:
> 13:38 tmp$ ./fcntl
> rc -1, errno 14, EINVAL 22
> I understand the NetBSD has some extension to the fcntl() which
> possible by standard. But the errno for incorrect command values
> should be equal to EINVAL, as far as I understood standard.
Your test program exhibits undefined behavior because it asks the
kernel to dereference an invalid pointer. EFAULT is therefore a
perfectly legitimate result.
(Although I'd argue that the process should also receive SIGSEGV.)
David A. Holland
Main Index |
Thread Index |