Back to index

nagios-plugins  1.4.16
Defines | Functions
full-write.c File Reference
#include <config.h>
#include "full-read.h"
#include <errno.h>
#include "safe-read.h"
#include "full-write.h"
#include "safe-write.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


#define safe_rw   safe_write
#define full_rw   full_write


size_t full_rw (int fd, const void *buf, size_t count)

Define Documentation

#define full_rw   full_write

Definition at line 38 of file full-write.c.

#define safe_rw   safe_write

Definition at line 37 of file full-write.c.


Definition at line 48 of file full-write.c.

Function Documentation

size_t full_rw ( int  fd,
const void *  buf,
size_t  count 

Definition at line 58 of file full-write.c.

  size_t total = 0;
  const char *ptr = (const char *) buf;

  while (count > 0)
      size_t n_rw = safe_rw (fd, ptr, count);
      if (n_rw == (size_t) -1)
      if (n_rw == 0)
          errno = ZERO_BYTE_TRANSFER_ERRNO;
      total += n_rw;
      ptr += n_rw;
      count -= n_rw;

  return total;