strerror () returns a short description of the error, given the error number as an argument. For example, if the argument is ENOTDIR, it will return “Not directory”, if the argument is EBUSY, it will return “Device or resource busy”, etc.
But is there a function returning "ENOTDIR" for the argument is equal to ENOTDIR, "EBUSY" for the argument EBUSY, etc.?
I just want to avoid writing a huge switch statement for this purpose.
, , , . , , , script for, -, ( ) . , OS X, . A script, , , , .
- , .
- switch, . errno , .
errno
.
, , , , , , . GNU/Linux errno :
/usr/include/asm-generic/errno-base.h /usr/include/asm-generic/errno.h
#define errno . . , , switch.
#define
, , .
Source: https://habr.com/ru/post/1654510/More articles:How to send json with byte in web api / postman - jsonWhy doesn't OrderedDict use super? - pythonWhy can't a function use a type limited to a type class only? - haskellhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1654508/how-to-use-xargs-to-replace-2-arguments&usg=ALkJrhhQzd-9YiWHthQTU4xa3o_SIV6gBABadPaddingException when trying to decrypt a Cypher fingerprint API - javaCakePHP 3 - How to automatically show form errors for several new objects? - phpHow to create a unique constraint for a type string field in EF 6? - c #The function expects arguments and returns a pointer to the void function - c ++How to make Aurelia destroy / recreate a view / viewModel pair without using a router - aureliaC ++ make links take up memory - c ++All Articles