When calling execl(...)
, I get an errno=2
. What does it mean? How can I know the meaning of this errno
?
Linux – How to know what the ‘errno’ means
c++errnolinux
Related Question
- How to use extern to share variables between source files
- C++ – the “–>” operator in C/C++
- Sqlite – Improve INSERT-per-second performance of SQLite
- Linux – How to change permissions for a folder and its subfolders/files in one step
- Node.js – How to update NodeJS and NPM to the next versions
- What does the ??!??! operator do in C
- Linux – “:-!!” in C code
- Linux – How to find all files containing specific text on Linux
Best Solution
You can use
strerror()
to get a human-readable string for the error number. This is the same string printed byperror()
but it's useful if you're formatting the error message for something other than standard error output.For example:
Linux also supports the explicitly-threadsafe variant
strerror_r()
.