Re: Patch for prctl(2)

Richard Gooch (rgooch@atnf.CSIRO.AU)
Wed, 27 Aug 1997 08:03:15 +1000


Andi Kleen writes:
> smurf@lap.noris.de (Matthias Urlichs) writes:
>
> > Richard Gooch <rgooch@atnf.CSIRO.AU> 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?
>
> Nope, -EINVAL is correct IMHO. -ENOSYS is only for non-existing syscall
> numbers, not for invalid parameters to existing syscalls. Other
> similar functions like fcntl(),ioctl(),setsockopt() etc. return
> -EINVAL too in this case.

Correct. I adopted the same model as fcntl(2), etc.

Regards,

Richard....