4 * Ullrich von Bassewitz, 02.06.1998
16 size_t fread (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 or EOF? */
27 if ((f->f_flags & (_FERROR | _FEOF)) != 0) {
28 /* Cannot read from stream */
32 /* How many bytes to read? */
38 bytes = read (f->f_fd, buf, bytes);
44 f->f_flags |= _FERROR;
53 /* Unfortunately, we cannot avoid the divide here... */