tech-kern archive

[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 08:06:15PM +0300, Andy Shevchenko wrote:
> On Fri, Aug 22, 2008 at 7:35 PM, David Holland 
> <dholland-tech%netbsd.org@localhost> wrote:
> > Your test program exhibits undefined behavior because it asks the
> > kernel to dereference an invalid pointer. EFAULT is therefore a
> > perfectly legitimate result.
>
> For what function?

Any function.  If your program includes *any* dereference of an invalid
pointer, it is exhibiting undefined behavior and it is impossible for it
to actually, then, be out of conformance with the standard.

I *like* all system calls fed invalid pointers to return EFAULT -- and
in this case, forcing it to return EINVAL would slow down a path that
should stay fast.

Thor


Home | Main Index | Thread Index | Old Index