Which systems define EAGAIN and EWOULDBLOCK as different values?

There were some… http://www.gnu.org/s/hello/manual/libc/Error-Codes.html Portability Note: In many older Unix systems, this condition was indicated by EWOULDBLOCK, which was a distinct error code different from EAGAIN. To make your program portable, you should check for both codes and treat them the same. http://lists.parisc-linux.org/hypermail/parisc-linux/9895.html On some SysV systems EAGAIN != EWOULDBLOCK. I think we inherited the … Read more

Is there a way to use errno safely in a multi-threaded application? [duplicate]

If your standard library is multithread aware, then it probably has a #define that changes errno into a function call that returns a thread-local error return value. However, to use this you generally must include <errno.h>, rather than relying on an extern declaration. I found an article Thread-safety and POSIX.1 which addresses this very question.

How to convert errno in UNIX to corresponding string?

strerror() should do it. http://linux.die.net/man/3/strerror FYI, so that you can find these things more easily, yourself: If you type man errno (or whatever function you’re investigating), and look at the very bottom of the man page, you’ll see a list of related functions. If you man each of those (taking a guess about which one(s) … Read more

How to set errno value?

For all practical purposes, you can treat errno like a global variable (although it’s usually not). So include errno.h and just use it: errno = ENOENT; You should ask yourself if errno is the best error-reporting mechanism for your purposes. Can the functions be engineered to return the error code themselves ?

Is &errno legal C?

So ยง6.5.3.2p1 specifies The operand of the unary & operator shall be either a function designator, the result of a [] or unary * operator, or an lvalue that designates an object that is not a bit-field and is not declared with the register storage-class specifier. Which I think can be taken to mean that … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)