src/nvim/fileio.c
/*
 * Version of write() that retries when interrupted by EINTR (possibly
 * by a SIGWINCH).
 */
Version of write() that retries when interrupted by EINTR (possibly
by a SIGWINCH).
Version of write () that retries when interrupted by EINTR ( possibly by a SIGWINCH ) .
long write_eintr(int fd, void *buf, size_t bufsize)
{
  long ret = 0;
  long wlen;
  while (ret < (long)bufsize) {
    wlen = write(fd, (char *)buf + ret, bufsize - ret);
    if (wlen < 0) {
      if (errno != EINTR)
        break;
    } else
      ret += wlen;
  }
  return ret;
}
long write_eintr ( int fd , void * buf , size_t bufsize ) { long ret = 0 ; long wlen ; while ( ret < ( long ) bufsize ) { wlen = write ( fd , ( char * ) buf + ret , bufsize - ret ) ; if ( wlen < 0 ) { if ( errno != EINTR ) break ; } else ret += wlen ; } return ret ; }
Version of write() that retries when interrupted by EINTR (possibly
 by a SIGWINCH).
Version of write () that retries when interrupted by EINTR ( possibly by a SIGWINCH ) .
/* Repeat the write() so long it didn't fail, other than being interrupted
   * by a signal. */