During testing, I have a mock object that sets errno = ETIMEDOUT; The object I'm testing sees an error and calls strerror_r to return an error string:
if (ret) { if (ret == EAI_SYSTEM) { char err[128]; strerror_r(errno, err, 128); err_string.assign(err); } else { err_string.assign(gai_strerror(ret)); } return ret; }
I do not understand why strerror_r returns the cart. I even tried to call
strerror_r(ETIMEDOUT, err, 128)
straight and still have trash. I have to miss something. It seems I am getting a gnu version of a non posix function, but this should not make any difference in this case.
Edit
I'm on Ubuntu 8.04. The glibc version looks like 2.7 in feature.h.
source share