Since the system subroutines are used by other library routines that
require reentrancy, `libc.a' provides cover routines (for example,
the reentrant version of fork
is _fork_r
). These cover
routines are consistent with the other reentrant subroutines in this
library, and achieve reentrancy by using a reserved global data block
(see section Reentrancy).
_open_r
open
. It takes a pointer
to the global data block, which holds errno
.
int _open_r(void *reent, const char *file, int flags, int mode);
_close_r
close
. It takes a pointer to the global
data block, which holds errno
.
int _close_r(void *reent, int fd);
_lseek_r
lseek
. It takes a pointer to the global
data block, which holds errno
.
off_t _lseek_r(void *reent, int fd, off_t pos, int whence);
_read_r
read
. It takes a pointer to the global
data block, which holds errno
.
long _read_r(void *reent, int fd, void *buf, size_t cnt);
_write_r
write
. It takes a pointer to the global
data block, which holds errno
.
long _write_r(void *reent, int fd, const void *buf, size_t cnt);
_fork_r
fork
. It takes a pointer to the global
data block, which holds errno
.
int _fork_r(void *reent);
_wait_r
wait
. It takes a pointer to the global
data block, which holds errno
.
int _wait_r(void *reent, int *status);
_stat_r
stat
. It takes a pointer to the global
data block, which holds errno
.
int _stat_r(void *reent, const char *file, struct stat *pstat);
_fstat_r
fstat
. It takes a pointer to the global
data block, which holds errno
.
int _fstat_r(void *reent, int fd, struct stat *pstat);
_link_r
link
. It takes a pointer to the global
data block, which holds errno
.
int _link_r(void *reent, const char *old, const char *new);
_unlink_r
unlink
. It takes a pointer to the global
data block, which holds errno
.
int _unlink_r(void *reent, const char *file);
_sbrk_r
sbrk
. It takes a pointer to the global
data block, which holds errno
.
char *_sbrk_r(void *reent, size_t incr);