Re: [PATCH] fs: fcntl, avoid undefined behaviour

From: Jiri Slaby
Date: Mon Oct 24 2016 - 07:34:47 EST


On 10/24/2016, 01:29 PM, Jeff Layton wrote:
> It looks like it lists this as a "may fail" case:
>
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/fcntl.html
>
> [EINVAL]
> The cmd argument is F_SETOWN and the value of the argument
> is not valid as a process or process group identifier.

Huh, my man 3p fcntl only lists [EDEADLK] at that point. (I have 2013
edition opposing to 2016 from the link above)

> IMO, returning an error here is the right thing to do. Either the
> application isn't checking for errors, in which case returning one won't
> matter, or it is, and they probably want to be informed that their
> F_SETOWN didn't do what they expected.

Ok, will do.

--
js
suse labs