diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2005-03-23 02:45:43 +0300 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2005-03-23 02:45:43 +0300 |
commit | 859c94e8de8c009b1ac20072005379c34bf7f395 (patch) | |
tree | 50b78ce5b43204afde3587691261d47d9bd5581f /newlib/libc/sys/arc | |
parent | eb35705027d77e1c0c5b896838f9f67289c7169c (diff) |
2005-03-22 Jeff Johnston <jjohnstn@redhat.com>
* configure.host: For arc, set -DREENTRANT_SYSCALLS_PROVIDED flag on.
* libc/sys/arc/syscalls.c: Change functions to use __errno_r rather
than errno.
Diffstat (limited to 'newlib/libc/sys/arc')
-rw-r--r-- | newlib/libc/sys/arc/syscalls.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/newlib/libc/sys/arc/syscalls.c b/newlib/libc/sys/arc/syscalls.c index 107989b00..9c578451a 100644 --- a/newlib/libc/sys/arc/syscalls.c +++ b/newlib/libc/sys/arc/syscalls.c @@ -15,7 +15,7 @@ _read_r (struct _reent *r, int fd, void *buf, size_t nbytes) SYSCALL (SYS_read, rc, err, fd, buf, nbytes); if (err) - errno = err; + __errno_r (r) = err; return rc; } @@ -27,7 +27,7 @@ _write_r (struct _reent *r, int fd, const void *buf, size_t nbytes) SYSCALL (SYS_write, rc, err, fd, buf, nbytes); if (err) - errno = err; + __errno_r (r) = err; return rc; } @@ -48,7 +48,8 @@ _open_r (struct _reent *r, const char *buf, int flags, int mode) #endif SYSCALL (SYS_open, rc, err, buf, flags, mode); - errno = err; + if (err) + __errno_r (r) = err; return rc; } @@ -59,7 +60,7 @@ _close_r (struct _reent *r, int fd) SYSCALL (SYS_close, rc, err, fd, 0, 0); if (err) - errno = err; + __errno_r (r) = err; return rc; } @@ -71,7 +72,7 @@ _lseek_r (struct _reent *r, int fd, off_t offset, int whence) SYSCALL (SYS_lseek, rc, err, fd, offset, whence); if (err) - errno = err; + __errno_r (r) = err; return rc; } @@ -82,7 +83,7 @@ _fstat_r (struct _reent *r, int fd, struct stat *buf) SYSCALL (SYS_fstat, rc, err, fd, buf, 0); if (err) - errno = err; + __errno_r (r) = err; return rc; } @@ -125,6 +126,6 @@ _kill_r (struct _reent *r, int pid, int sig) SYSCALL (SYS_kill, rc, err, pid, sig, 0); if (err) - errno = err; + __errno_r (r) = err; return rc; } |