From: Jeff Johnston Date: Tue, 22 Mar 2005 23:45:43 +0000 (+0000) Subject: 2005-03-22 Jeff Johnston X-Git-Tag: msnyder-tracepoint-checkpoint-branchpoint~274 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=859c94e8de8c009b1ac20072005379c34bf7f395;p=newlib-cygwin.git 2005-03-22 Jeff Johnston * configure.host: For arc, set -DREENTRANT_SYSCALLS_PROVIDED flag on. * libc/sys/arc/syscalls.c: Change functions to use __errno_r rather than errno. --- diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 1fff903e0..552da88f5 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,9 @@ +2005-03-22 Jeff Johnston + + * configure.host: For arc, set -DREENTRANT_SYSCALLS_PROVIDED flag on. + * libc/sys/arc/syscalls.c: Change functions to use __errno_r rather + than errno. + 2005-03-22 Christopher Faylor * libc/include/machine/_types.h: Make trivial change to comment to diff --git a/newlib/configure.host b/newlib/configure.host index 2265e7b66..dbf063676 100644 --- a/newlib/configure.host +++ b/newlib/configure.host @@ -502,6 +502,9 @@ case "${host}" in newlib_cflags="${newlib_cflags} -DARM_RDI_MONITOR" fi ;; + arc*) + newlib_cflags="${newlib_cflags} -DREENTRANT_SYSCALLS_PROVIDED" + ;; avr*) newlib_cflags="${newlib_cflags} -DNO_EXEC -DSMALL_MEMORY -DMISSING_SYSCALL_NAMES" ;; 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; }