ReactOS  0.4.15-dev-4916-gd519b11
ffileread.c File Reference
#include "schilyio.h"
Include dependency graph for ffileread.c:

Go to the source code of this file.


EXPORT ssize_t ffileread (FILE *f, void *buf, size_t len)

Function Documentation

◆ ffileread()

EXPORT ssize_t ffileread ( FILE f,
void buf,
size_t  len 

Definition at line 20 of file ffileread.c.

24 {
25  register int fd;
26  register ssize_t ret;
27  int oerrno = geterrno();
29  down2(f, _IOREAD, _IORW);
30  fd = fileno(f);
32  while ((ret = read(fd, buf, len)) < 0 && geterrno() == EINTR) {
33  /*
34  * Set back old 'errno' so we don't change the errno visible
35  * to the outside if we did not fail.
36  */
37  seterrno(oerrno);
38  }
39  return (ret);
40 }
#define EINTR
Definition: acclib.h:80
static int fd
Definition: io.c:51
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define _IOREAD
Definition: stdio.h:124
GLfloat f
Definition: glext.h:7540
EXPORT int seterrno(int err)
Definition: seterrno.c:34
_Check_return_ _CRTIMP int __cdecl fileno(_In_ FILE *_File)
EXPORT int geterrno()
Definition: geterrno.c:34
int ret
GLenum GLsizei len
Definition: glext.h:6722
int ssize_t
Definition: rosdhcp.h:48
#define down2(f, fl1, fl2)
Definition: schilyio.h:218
#define _IORW
Definition: stdio.h:135
_CRTIMP int __cdecl read(_In_ int _FileHandle, _Out_writes_bytes_(_MaxCharCount) void *_DstBuf, _In_ unsigned int _MaxCharCount)

Referenced by write_one_file().