The C function strerror returns an error description string, as detailed here. Example string
No such file or directory
The question is where are these strings defined? I looked through my header files and did not see anything.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
They’re defined somewhere in the C library, traditionally in a global array of
char*calledsys_errlistof lengthsys_nerr, at least on Unix systems.Because legacy programs, written before
strerrorwas standardized, may access this array directly, it’s still available even on modern GNU/Linux and Mac OS X for backward compatibility (though you really shouldn’t access it except throughperrororstrerror).E.g, here’s the Mac OS X 10.8.2 definition of
sys_errlist.