OSDN Git Service

2007-06-20 Patrick Mansfield <patmans@us.ibm.com>
authorjjohnstn <jjohnstn>
Wed, 20 Jun 2007 21:54:47 +0000 (21:54 +0000)
committerjjohnstn <jjohnstn>
Wed, 20 Jun 2007 21:54:47 +0000 (21:54 +0000)
        * libc/machine/spu/perror.c: Pass errno as the second argument to
        the assist call.

newlib/ChangeLog
newlib/libc/machine/spu/perror.c

index 1069c74..39bd297 100644 (file)
@@ -1,5 +1,10 @@
 2007-06-20  Patrick Mansfield  <patmans@us.ibm.com>
 
+       * libc/machine/spu/perror.c: Pass errno as the second argument to
+       the assist call.
+
+2007-06-20  Patrick Mansfield  <patmans@us.ibm.com>
+
        * libc/include/sys/unistd.h[__SPU__]: Add lockf prototype and related
        defines; expose ftruncate, truncate and sync prototypes.
 
index 63e7fe8..028f44a 100644 (file)
@@ -1,17 +1,30 @@
 #include <stdio.h>
+#include <errno.h>
 
 #include "c99ppe.h"
 
 #ifndef _REENT_ONLY
 
+typedef struct
+{
+  _CONST char* str;
+  unsigned int pad0[ 3 ];
+  int arg_errno;
+  unsigned int pad1[ 3 ];
+} c99_perror_t;
+
 void
 _DEFUN (perror, (s),
        _CONST char *s)
 
 {
+  c99_perror_t arg;
+
   CHECK_STD_INIT(_REENT);
 
-  __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_PERROR, &s);
+  arg.str = s;
+  arg.arg_errno = errno;
+  __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_PERROR, &arg);
 
   return;
 }