lkml.org 
[lkml]   [1999]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: funny inconsistency in error returns
From
Date
Andries.Brouwer@cwi.nl writes:

|> I see ENXIO upon open("/dev/hdd"), and ENODEV upon open("/dev/hde");
|> It is clear why this happens
|> (hde has major 33, and blkdev_open does not know it and returns -ENODEV;
|> hdd has major 22, known since hdc exists, and ide_open returns -ENXIO).
|> Both error numbers are OK, but the inconsistency is a microscopic flaw.
|> Maybe ide_open() should also return ENODEV.

I think both should be using ENXIO. From the glibc docs:

- Macro: int ENXIO
No such device or address. The system tried to use the device
represented by a file you specified, and it couldn't find the
device. This can mean that the device file was installed
incorrectly, or that the physical device is missing or not
correctly attached to the computer.

- Macro: int ENODEV
The wrong type of device was given to a function that expects a
particular sort of device.

--
Andreas Schwab "And now for something
schwab@issan.cs.uni-dortmund.de completely different"
schwab@gnu.org

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:50    [W:0.051 / U:0.540 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site