1 /* Reentrant versions of read system call. */
7 /* Some targets provides their own versions of this functions. Those
8 targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS. */
11 #ifndef REENTRANT_SYSCALLS_PROVIDED
12 #define REENTRANT_SYSCALLS_PROVIDED
16 #ifndef REENTRANT_SYSCALLS_PROVIDED
18 /* We use the errno variable used by the system dependent layer. */
24 <<_read_r>>---Reentrant version of read
31 _ssize_t _read_r(struct _reent *<[ptr]>,
32 int <[fd]>, void *<[buf]>, size_t <[cnt]>);
35 This is a reentrant version of <<read>>. It
36 takes a pointer to the global data block, which holds
41 _read_r (struct _reent
*ptr
,
49 if ((ret
= (_ssize_t
)_read (fd
, buf
, cnt
)) == -1 && errno
!= 0)
50 _REENT_ERRNO(ptr
) = errno
;
54 #endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */