From be97722968a0b7d1cc3fe1ab7df0510c5b8eed95 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Wed, 20 Jun 2007 21:54:47 +0000 Subject: 2007-06-20 Patrick Mansfield * libc/machine/spu/perror.c: Pass errno as the second argument to the assist call. --- newlib/libc/machine/spu/perror.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'newlib/libc') diff --git a/newlib/libc/machine/spu/perror.c b/newlib/libc/machine/spu/perror.c index 63e7fe82c..028f44a37 100644 --- a/newlib/libc/machine/spu/perror.c +++ b/newlib/libc/machine/spu/perror.c @@ -1,17 +1,30 @@ #include +#include #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; } -- cgit v1.2.3