4 * Ullrich von Bassewitz, 04.06.1998
16 size_t fwrite (const void* buf, size_t size, size_t count, FILE* f)
20 /* Is the file open? */
21 if ((f->f_flags & _FOPEN) == 0) {
22 _errno = EINVAL; /* File not open */
26 /* Did we have an error */
27 if ((f->f_flags & _FERROR) != 0) {
28 /* Cannot write to stream */
32 /* How many bytes to write? */
37 if (write (f->f_fd, buf, bytes) == -1) {
39 f->f_flags |= _FERROR;
44 /* Don't waste time with expensive calculations, assume the write was
45 * complete and return the count of items.