Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I am just saying that the abstractions that the drivers can implement, can be pretty diverse. A particular ioctl may very well be dealing with a container like abstraction (contained items may or may not be file paths), and some return value that indicates "NO SUCH ENTRY" (i.e. ENOENT) may not be so out of order.

These examples are contrived, but consider a driver returning a encryption key corresponding to a index, which is stored in some encryption hardware table (controlled by the driver). Or a driver could be maintaining a cache, which is indexed by a key. Or even routing entries. There are a million possibilities.

I have to admit that I have used ENOENT for cases where "NO SUCH ENTRY" made sense. But maybe the tradition is to exclusively use it for path based operations only. I better shut up before Linus gets on my case. Because it would not be good for the Linux world at all. I'd probably clock him really badly if he spoke to me like that.



As far as I know, the "ENT" in ENOENT refers specifically to a "dentry" (directory entry), i.e. the kernel data structure `struct dentry`, identified by a pathname in the virtual file system. It's not supposed to be a generic term for an entry in some arbitrary container of data.

I do see where you're coming from now, but I still think any usage other than the standard "no such file" meaning is errno abuse.


Seems reasonable enough. Can't help but wonder though, that a lot or the other errnos were probably also invented for very specific contexts, but find use in a wider sense because they capture a more generic error class.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: