When UNIX system-level functions encounter errors, they typically return-1, and set the global integer variable errno to indicate what went wrong.
Read the Redis source code, found that if the system-level function error when the errno more familiar with the program to write a lot. So, while learning Apue and Csapp, the common system-level functions of their own encountered in the error when the return of the errno summed up (otherwise each perror once, good tired ah = =), will continue to find time to update the learning progress ~
Echild:
#include <sys/types.h><sys/wait.h>intint options);
If the calling process has no child processes, then Waitpid returns-1 and sets errno to Echild
Einter:
#include <sys/types.h><sys/wait.h>intint options);
If the Waitpid function is interrupted by a signal, then it returns-1 and sets errno to Eintr
EINVAL:
#include <unistd.h>
long sysconf (int name); long pathconf (constcharint name); log fpathconf (int int name);
If the name parameter is not a suitable constant, all 3 functions return-1, and the errno is set to Einval
Espipe:
#include <unistd.h>offt_t lseek (intint whence);
If the file descriptor points to a pipe, FIFO, or network socket, because these files cannot set an offset, Lseek returns-1, and errno is set to Espipe
UNIX system Call function errno return value collection (in updating)