[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RTEMS use of Linux specific errno's
- Date: Fri, 12 Jun 2009 09:39:41 -0500
- From: joel.sherrill at OARcorp.com (Joel Sherrill)
- Subject: RTEMS use of Linux specific errno's
Peter Dufault wrote:
> On Jun 11, 2009, at 2:42 , Joel Sherrill wrote:
>
>
>> I am pretty happy changing EBADRQC to EINVAL but
>> I don't know what ENOTBLOCK should change to.
>>
>
> I would use ENOTTY, or maybe ENODEV. The name might be ENOTTY but the
> strerror() text is appropriate.
>
> From http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_03.html#tag_02_03
>
> [ENOTTY] Inappropriate I/O control operation. A control function has
> been attempted for a file or special file for which the operation is
> inappropriate.
>
> [ENODEV] No such device. An attempt was made to apply an inappropriate
> function to a device; for example, trying to read a write-only device
> such as a printer.
>
from the ioctl man page
EINVAL Request or argp is not valid.
So for simple cases of bad ioctl request number, this is the
right error. I think the others cases fall into the ENODEV sounds
better. Most of the cases would be doing a block operation
on a character device and getting back ENOTTY would confuse
me.
How does that sound?
--joel
> Peter
>
--
Joel Sherrill, Ph.D. Director of Research & Development
joel.sherrill at OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985