Here is a simple program that illustrates the problem.
#include <string.h> #include <iostream> int main () { char buf [30]; strerror_r (0, buf, sizeof (buf)); std :: cout << "strerror_r(0): " << buf << std :: endl; std :: cout << "strerror(0): " << strerror (0) << std :: endl; }
Here is the result.
strerror_r(0): strerror(0): Success
Why is there nothing in buf ?
(Compiled on Ubuntu with gcc.)
source share