3 #include <sys/syscall.h>
11 _read_r (struct _reent
*r
, int fd
, void *buf
, size_t nbytes
)
16 SYSCALL (SYS_read
, rc
, err
, fd
, buf
, nbytes
);
23 _write_r (struct _reent
*r
, int fd
, const void *buf
, size_t nbytes
)
28 SYSCALL (SYS_write
, rc
, err
, fd
, buf
, nbytes
);
34 /* FIXME: The prototype in <fcntl.h> for open() uses ...,
35 but reent.h uses int. */
38 _open_r (struct _reent
*r
, const char *buf
, int flags
, int mode
)
46 mode
= va_arg (ap
, int);
50 SYSCALL (SYS_open
, rc
, err
, buf
, flags
, mode
);
56 _close_r (struct _reent
*r
, int fd
)
60 SYSCALL (SYS_close
, rc
, err
, fd
, 0, 0);
67 _lseek_r (struct _reent
*r
, int fd
, off_t offset
, int whence
)
72 SYSCALL (SYS_lseek
, rc
, err
, fd
, offset
, whence
);
79 _fstat_r (struct _reent
*r
, int fd
, struct stat
*buf
)
83 SYSCALL (SYS_fstat
, rc
, err
, fd
, buf
, 0);
89 /* FIXME: Shouldn't this be _exit_r? */
96 SYSCALL (SYS_exit
, rc
, err
, ret
, 0, 0);
98 /* If that failed, use an infinite loop. */
104 _time (time_t *timer
)
110 _creat_r (struct _reent
*r
, const char *path
, int mode
)
112 return _open_r (r
, path
, O_CREAT
| O_TRUNC
, mode
);
116 _getpid_r (struct _reent
*r
)
122 _kill_r (struct _reent
*r
, int pid
, int sig
)
126 SYSCALL (SYS_kill
, rc
, err
, pid
, sig
, 0);