Messages in this thread | | | Date | Sat, 28 Jan 2012 00:50:26 +0400 | From | Cyrill Gorcunov <> | Subject | Re: [RFC c/r 2/4] [RFC] syscalls, x86: Add __NR_kcmp syscall v7 |
| |
On Fri, Jan 27, 2012 at 12:33:07PM -0800, Eric W. Biederman wrote: > KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> writes: > >> + ret = kcmp_ptr((long)filp1, (long)filp2, KCMP_FILE); > >> + else > >> + ret = -ENOENT; > > > > If my remember is correct, Andrew pointed out EINVAL is better than ENOENT. > > Ah yes. And really what it should be is > if (!filp1 || !filp2) > return -EBADF; > > At least EBADF is what you return if it is your process that doesn't > have the filedescriptor. >
Eric, I've sent out version with
if (filp1 && filp2) ... else ret = -EBADF;
maybe you're lookin into previous version?
> >> + KCMP_SYSVSEM); > >> +#else > >> + ret = -EINVAL; > > > > ENOTSUP is better, I think. because of, EINVAL implicitly mean _caller_ is wrong. > > but in this case, it is not bad. only the kernel doesn't have enough > > feature. > > Careful a type compiled out should in principle match a type whose > support has not been implemented. That is the default case should match > what happens when you don't compile in sysvipc support.
I don't get it :) Will -EINVAL be enough or not?
Cyrill
| |