OSDN Git Service

2008-08-20 Jose Ruiz <ruiz@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 20 Aug 2008 12:36:24 +0000 (12:36 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 20 Aug 2008 12:36:24 +0000 (12:36 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139284 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/errno.c

index 93981d6..1f3497d 100644 (file)
@@ -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- *
 #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