RTEMS use of Linux specific errno's

Joel Sherrill joel.sherrill at OARcorp.com
Fri Jun 12 14:39:41 UTC 2009

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

How does that sound?

> 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

More information about the users mailing list