Added _stat_r and changed spacing.

This commit is contained in:
Joel Sherrill
1998-07-01 21:33:38 +00:00
parent dd6dddcf1e
commit a05de51283

View File

@@ -23,56 +23,70 @@
#include "internal.h" #include "internal.h"
#include "libio.h" #include "libio.h"
_ssize_t _ssize_t _read_r(
_read_r(struct _reent *ptr, struct _reent *ptr,
int fd, int fd,
void *buf, void *buf,
size_t nbytes) size_t nbytes
{
return __rtems_read(fd, buf, nbytes);
}
long
_write_r(struct _reent *ptr,
int fd,
const void *buf,
size_t nbytes
) )
{ {
return __rtems_write(fd, buf, nbytes); return __rtems_read(fd, buf, nbytes);
} }
int long _write_r(
_open_r(struct _reent *ptr, struct _reent *ptr,
const char *buf, int fd,
int flags, const void *buf,
int mode) size_t nbytes
)
{ {
return __rtems_open(buf, flags, mode); return __rtems_write(fd, buf, nbytes);
} }
int int _open_r(
_close_r(struct _reent *ptr, struct _reent *ptr,
int fd) const char *buf,
int flags,
int mode
)
{ {
return __rtems_close(fd); return __rtems_open(buf, flags, mode);
} }
off_t int _close_r(
_lseek_r(struct _reent *ptr, struct _reent *ptr,
int fd, int fd
off_t offset, )
int whence)
{ {
return __rtems_lseek(fd, offset, whence); return __rtems_close(fd);
} }
int off_t _lseek_r(
_fstat_r(struct _reent *ptr, struct _reent *ptr,
int fd, int fd,
struct stat *buf) off_t offset,
int whence
)
{ {
return __rtems_fstat(fd, buf); return __rtems_lseek(fd, offset, whence);
}
int _stat_r(
struct _reent *ptr,
const char *path,
struct stat *buf
)
{
return stat(path, buf);
}
int _fstat_r(
struct _reent *ptr,
int fd,
struct stat *buf
)
{
return __rtems_fstat(fd, buf);
} }
pid_t _getpid_r(struct _reent *ptr) pid_t _getpid_r(struct _reent *ptr)