library/socket.c
ssize_t writen(int fd, const void *vptr, size_t n)
{
  size_t     remaining;
  ssize_t    written;
  const char *ptr;

  remaining = n;
  ptr = vptr;
  while (remaining > 0) {
    written = write(fd, ptr, remaining);
    if (written <= 0) {
      if (written < 0)  warn("write");
      return written;
    }
    remaining -= written;
    ptr += written;
  }
  return n;
}
// Advanced Programming in the Unix Environment, Program 12.12
Advanced Programming in the Unix Environment, Program 12.12
Advanced Programming in the Unix Environment Program 12 . 12
ssize_t writen(int fd, const void *vptr, size_t n)
{
  size_t     remaining;
  ssize_t    written;
  const char *ptr;
  remaining = n;
  ptr = vptr;
  while (remaining > 0) {
    written = write(fd, ptr, remaining);
    if (written <= 0) {
      if (written < 0)  warn("write");
      return written;
    }
    remaining -= written;
    ptr += written;
  }
  return n;
}
ssize_t writen ( int fd , const void * vptr , size_t n ) { size_t remaining ; ssize_t written ; const char * ptr ; remaining = n ; ptr = vptr ; while ( remaining > 0 ) { written = write ( fd , ptr , remaining ) ; if ( written <= 0 ) { if ( written < 0 ) warn ( " " ) ; return written ; } remaining -= written ; ptr += written ; } return n ; }
Advanced Programming in the Unix Environment, Program 12.12
Advanced Programming in the Unix Environment Program 12 . 12