From a05de51283471eca79b981be665008a898613d03 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 1 Jul 1998 21:33:38 +0000 Subject: Added _stat_r and changed spacing. --- c/src/lib/libc/newlibifr.c | 80 +++++++++++++++++++++++++++------------------- 1 file changed, 47 insertions(+), 33 deletions(-) (limited to 'c/src') diff --git a/c/src/lib/libc/newlibifr.c b/c/src/lib/libc/newlibifr.c index 1879239f9e..5d870c91a6 100644 --- a/c/src/lib/libc/newlibifr.c +++ b/c/src/lib/libc/newlibifr.c @@ -23,56 +23,70 @@ #include "internal.h" #include "libio.h" -_ssize_t -_read_r(struct _reent *ptr, - int fd, - void *buf, - size_t nbytes) +_ssize_t _read_r( + struct _reent *ptr, + int fd, + void *buf, + size_t nbytes +) { - return __rtems_read(fd, buf, nbytes); + return __rtems_read(fd, buf, nbytes); } -long -_write_r(struct _reent *ptr, - int fd, - const void *buf, - size_t nbytes +long _write_r( + struct _reent *ptr, + int fd, + const void *buf, + size_t nbytes ) { - return __rtems_write(fd, buf, nbytes); + return __rtems_write(fd, buf, nbytes); } -int -_open_r(struct _reent *ptr, - const char *buf, - int flags, - int mode) +int _open_r( + struct _reent *ptr, + const char *buf, + int flags, + int mode +) { - return __rtems_open(buf, flags, mode); + return __rtems_open(buf, flags, mode); } -int -_close_r(struct _reent *ptr, - int fd) +int _close_r( + struct _reent *ptr, + int fd +) { - return __rtems_close(fd); + return __rtems_close(fd); } -off_t -_lseek_r(struct _reent *ptr, - int fd, - off_t offset, - int whence) +off_t _lseek_r( + struct _reent *ptr, + int fd, + off_t offset, + int whence +) { - return __rtems_lseek(fd, offset, whence); + return __rtems_lseek(fd, offset, whence); } -int -_fstat_r(struct _reent *ptr, - int fd, - struct stat *buf) +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); + return __rtems_fstat(fd, buf); } pid_t _getpid_r(struct _reent *ptr) -- cgit v1.2.3