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:01:03PM +0300, Andy Shevchenko wrote:
> On Fri, Aug 22, 2008 at 6:55 PM, Simon Burge <simonb%netbsd.org@localhost> 
> wrote:
> > Does section B.2.3 of
> > http://www.opengroup.org/onlinepubs/009695399/xrat/xsh_chap02.html give
> > us freedom here to report those extra errno values?
> If a command value, f.e. -2, not valid, it doesn't, because the
> ERRORS: section contains "shall" is mandatory. And in that section the
> invalid command causes EINVAL.
> Am I wrong?

If you only had one thing wrong with your operation, you'd be right 
according to the spec. You however have two things wrong, and we're 
telling you about the second one.

I see no discussion in the spec (which really seems to be 
http://www.opengroup.org/onlinepubs/009695399/functions/fcntl.html) about 
what should happen when we pass in a bad pointer to the defined operations 
that take a pointer. That looks like a deficiency of the spec.

Try passing the address to 4k of data to the invalid operation code and 
see what happens. You should then see whatever the file system for 'fd' 
does, and it should report EINVAL.

If the file system doesn't support the op, you should get back EINVAL.

Take care,

Bill

Attachment: pgpBgg0LLInyP.pgp
Description: PGP signature



Home | Main Index | Thread Index | Old Index