Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Joyce <matthew.joyce@embedded-brains.de>2022-01-18 12:13:04 +0300
committerSebastian Huber <sebastian.huber@embedded-brains.de>2022-07-13 07:55:41 +0300
commitf3b8138239d3ba34c4ecaa4305b0fbd7eb4e28a5 (patch)
tree80cc7a629134d4568bf5dc71898266555a6863b0 /newlib/libc/machine/spu
parentd0d78e96ebf4187fb9362465f1a397680447046f (diff)
Add _REENT_ERRNO(ptr)
Add a _REENT_ERRNO() macro to encapsulate the access to the _errno member of struct reent. This will help to replace the structure member with a thread-local storage object in a follow up patch. Replace uses of __errno_r() with _REENT_ERRNO(). Keep __errno_r() macro for potential users outside of Newlib.
Diffstat (limited to 'newlib/libc/machine/spu')
-rw-r--r--newlib/libc/machine/spu/stdio.c2
-rw-r--r--newlib/libc/machine/spu/sys/errno.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/newlib/libc/machine/spu/stdio.c b/newlib/libc/machine/spu/stdio.c
index 87e4c406d..1dcc88b60 100644
--- a/newlib/libc/machine/spu/stdio.c
+++ b/newlib/libc/machine/spu/stdio.c
@@ -47,7 +47,7 @@ __sfp (struct _reent *d)
return &__fp[i];
}
}
- d->_errno = EMFILE;
+ _REENT_ERRNO(d) = EMFILE;
return NULL;
}
diff --git a/newlib/libc/machine/spu/sys/errno.h b/newlib/libc/machine/spu/sys/errno.h
index b008ff6f4..8758283eb 100644
--- a/newlib/libc/machine/spu/sys/errno.h
+++ b/newlib/libc/machine/spu/sys/errno.h
@@ -34,7 +34,7 @@ extern "C" {
extern const char * const _sys_errlist[];
extern int _sys_nerr;
-#define __errno_r(ptr) ((ptr)->_errno)
+#define __errno_r(ptr) _REENT_ERRNO(ptr)
/* Adjusted to the linux asm/errno.h */
#define EPERM 1 /* Operation not permitted */