Re: Patch for prctl(2)

Matthias Urlichs (smurf@lap.noris.de)
27 Aug 1997 05:41:25 +0200


Richard Henderson <rth@cygnus.com> writes:
> > > +asmlinkage int sys_prctl(int option, unsigned long arg2, unsigned long arg3,
> > > + unsigned long arg4, unsigned long arg5)
> > > +{
> > > + switch (option) {
> > > + default:
> > > + error = -EINVAL;
> >
> > Shouldn't that rather be -ENOSYS?
>
> No, ENOSYS says that the entire syscall is not supported. You
> are thinking of EOPNOTSUPP, I believe.

You're right.

I'm trying to distinguish "I can't do that because you supplied wrong
parameters" (EINVAL) from "I don't know how to do that (yet?)". The latter,
when talking about syscalls, is ENOSYS.

This distinction is of some value with 'ordinary' system calls (we could
call that the zeroth parameter to the system call ;-) and I believe it
should also be made with 'what-exactly-should-I-do' arguments to system
calls (the first parameter, as opposed to the second one which definitely
should get EINVAL).

Or something like that.