This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 8/8] SPU pass errno to perror assist call


The assist call interface changed to take errno as the second argument to
perror, so perror on PPU can use the SPU errno, and not the PPU one.

newlib ChangeLog:

2007-06-18 Patrick Mansfield <patmans@us.ibm.com>

	* libc/machine/spu/perror.c: Pass errno as the second argument to
	the assist call.

Index: quilt/newlib/libc/machine/spu/perror.c
===================================================================
--- quilt.orig/newlib/libc/machine/spu/perror.c
+++ quilt/newlib/libc/machine/spu/perror.c
@@ -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;
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]