aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Ruiz <ruiz@adacore.com>2008-08-20 14:36:24 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2008-08-20 14:36:24 +0200
commita0005b2e7b9186eb071bb44ad5d80559bac82222 (patch)
tree7ee5b30e090dce17b8b3dcb50c428cf67de2c77f
parentd3b1401d07ff4874964a8b534dfd8cd94dc978ae (diff)
downloadgcc-a0005b2e7b9186eb071bb44ad5d80559bac82222.zip
gcc-a0005b2e7b9186eb071bb44ad5d80559bac82222.tar.gz
gcc-a0005b2e7b9186eb071bb44ad5d80559bac82222.tar.bz2
errno.c (__get_errno for MaRTE): Use the MaRTE function pthread_errno to get access to the per-task errno variable.
2008-08-20 Jose Ruiz <ruiz@adacore.com> * errno.c (__get_errno for MaRTE): Use the MaRTE function pthread_errno to get access to the per-task errno variable. (__set_errno for MaRTE): Do not redefine this function here since it is already defined in MaRTE. From-SVN: r139284
-rw-r--r--gcc/ada/errno.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/gcc/ada/errno.c b/gcc/ada/errno.c
index 93981d6..1f3497d 100644
--- a/gcc/ada/errno.c
+++ b/gcc/ada/errno.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2005, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2008, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@@ -41,6 +41,21 @@
#define _THREAD_SAFE
#define _SGI_MP_SOURCE
+#ifdef MaRTE
+
+/* Function that returns a pointer to the per-task errno variable */
+extern int *pthread_errno (void);
+
+int
+__get_errno (void)
+{
+ return *pthread_errno ();
+}
+
+/* Function __set_errno is already defined in package MaRTE.POSIX_Pthread */
+
+#else
+
#include <errno.h>
int
__get_errno(void)
@@ -53,3 +68,5 @@ __set_errno(int err)
{
errno = err;
}
+
+#endif