Back to index

glibc  2.9
iofwrite_u.c File Reference
#include "libioP.h"
#include <stdio.h>

Go to the source code of this file.


_IO_size_t fwrite_unlocked (void *buf, _IO_size_t size, _IO_size_t count, _IO_FILE *fp) const

Function Documentation

_IO_size_t fwrite_unlocked ( void *  buf,
_IO_size_t  size,
_IO_size_t  count,
_IO_FILE fp 
) const

Definition at line 34 of file iofwrite_u.c.

  _IO_size_t request = size * count;
  _IO_size_t written = 0;
  CHECK_FILE (fp, 0);
  if (request == 0)
    return 0;
  if (_IO_fwide (fp, -1) == -1)
      written = _IO_sputn (fp, (const char *) buf, request);
      /* We have written all of the input in case the return value indicates
        this or EOF is returned.  The latter is a special case where we
        simply did not manage to flush the buffer.  But the data is in the
        buffer and therefore written as far as fwrite is concerned.  */
      if (written == request || written == EOF)
       return count;

  return written / size;

Here is the call graph for this function:

Here is the caller graph for this function: