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 Reentrancy).
_open_ropen. 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_rclose. It takes a pointer to the global
data block, which holds errno.
int _close_r(void *reent, int fd);
_lseek_rlseek. 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_rread. 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_rwrite. 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_rfork. It takes a pointer to the global
data block, which holds errno.
int _fork_r(void *reent);
_wait_rwait. It takes a pointer to the global
data block, which holds errno.
int _wait_r(void *reent, int *status);
_stat_rstat. It takes a pointer to the global
data block, which holds errno.
int _stat_r(void *reent,
const char *file, struct stat *pstat);
_fstat_rfstat. It takes a pointer to the global
data block, which holds errno.
int _fstat_r(void *reent,
int fd, struct stat *pstat);
_link_rlink. It takes a pointer to the global
data block, which holds errno.
int _link_r(void *reent,
const char *old, const char *new);
_unlink_runlink. It takes a pointer to the global
data block, which holds errno.
int _unlink_r(void *reent, const char *file);
_sbrk_rsbrk. It takes a pointer to the global
data block, which holds errno.
char *_sbrk_r(void *reent, size_t incr);