Not logged in
Log in now
Create an account
Subscribe to LWN
LWN.net Weekly Edition for June 20, 2013
Pencil, Pencil, and Pencil
Dividing the Linux desktop
LWN.net Weekly Edition for June 13, 2013
A report from pgCon 2013
Making EPERM friendlier
Posted Jan 20, 2013 18:59 UTC (Sun) by akeane (subscriber, #85436)
_open is the normal one
__open_ret_32 is the OMG MORE ERROR CODEZ!!!
So, you need a set of extra syscalls in the kernel to add more info to the ret value, (luckily this will add even more lines of code and complexity to the kernel, what could go wrong? yay!)
and a switch in the C lib:
cc -o my_earthly_soul p_audio.cs -DOMGMOREERRNOSSUCKA
But this is assuming that anybody actually goes around checking error codes in this modern era; no one really bothers anyway; if it's a real problem and not just the kernel nagging at you then something else will break properly later on and you get a nice SEGV which you can blame on a third party device driver.
It also becomes increasing difficult to add additional lines of error checking code when you reach a certain age, and your monocle has seen better days (also you waste valuable bytes on your winchester disk)
I stand by my assertion that only two ERR codes are necessary in your typical unix warez:
fd = open("~/Music/a-dreadful-din.mp1");
if(fd == E:-) )
if(fd == E:-( ))
if(fd == EAKEANE) /* Clearly a measure of success */
/* Remove rubbish modern so-called "music" */
/* Check for errors from unlink? nah... */
if(fd == EGETOFFMYLAWN)
unlink("~"); /* There's probably some bad music there somewhere */
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds