1 #ifndef DINIT_UTIL_H_INCLUDED
2 #define DINIT_UTIL_H_INCLUDED 1
10 // Signal-safe read. Read and re-try if interrupted by signal (EINTR).
11 // *May* affect errno even on a successful read (when the return is less than n).
12 inline ssize_t ss_read(int fd, void * buf, size_t n)
14 char * cbuf = static_cast<char *>(buf);
16 while ((size_t)r < n) {
17 ssize_t res = read(fd, cbuf + r, n - r);
26 // If any other error, and we have successfully read some, return it: