Re: changing EINVAL for SIOCSIFCAP to something else
- From: Gleb Smirnoff <glebius@xxxxxxxxxxx>
- Date: Mon, 27 Feb 2006 12:34:31 +0300
Andre, Yar,
On Mon, Feb 27, 2006 at 10:04:28AM +0100, Andre Oppermann wrote:
A> > I prefer this variant:
A> >
A> > if (ifp->if_ioctl == NULL)
A> > return (ENOTTY);
A> > if (ifr->ifr_reqcap & ~ifp->if_capabilities)
A> > return (ENODEV);
A> >
A> > Any objections?
A>
A> I don't think ENOTTY is appropriate here even though the comment to this
A> error code would fit. But the define still says no TTY which is totally
A> unrelated and confusing.
It contains a confusing word "tty", but it means "Inappropriate ioctl for device".
This error code is used in many places throughout the kernel. We already have
some ENOTTY returns in src/sys/net.
Y> I'm afraid that this is a case when EINVAL is used properly: an
Y> argument to ioctl doesn't make sense to a particular device. It's
Y> true that EINVAL may be abused in other places though. I wish each
Y> EINVAL being returned to the userland were accompanied by log().
I don't agree. EINVAL can logically fit to almost any error condition. We
should fine error codes fitting better. If "ioctl doesn't make sense to a
particular device", then we should say "Operation not supported by device",
which is ENODEV.
--
Totus tuus, Glebius.
GLEBIUS-RIPN GLEB-RIPE
_______________________________________________
freebsd-arch@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"
- Follow-Ups:
- Re: changing EINVAL for SIOCSIFCAP to something else
- From: Yar Tikhiy
- Re: changing EINVAL for SIOCSIFCAP to something else
- References:
- changing EINVAL for SIOCSIFCAP to something else
- From: Gleb Smirnoff
- Re: changing EINVAL for SIOCSIFCAP to something else
- From: Yar Tikhiy
- Re: changing EINVAL for SIOCSIFCAP to something else
- From: Andre Oppermann
- changing EINVAL for SIOCSIFCAP to something else
- Prev by Date: Re: changing EINVAL for SIOCSIFCAP to something else
- Next by Date: Re: changing EINVAL for SIOCSIFCAP to something else
- Previous by thread: Re: changing EINVAL for SIOCSIFCAP to something else
- Next by thread: Re: changing EINVAL for SIOCSIFCAP to something else
- Index(es):