diff syscalls.c @ 36:2ecde7a4bc55

Don't use evil errno kludge, write a function that libc can use.
author Daniel O'Connor <darius@dons.net.au>
date Tue, 26 Mar 2013 15:09:46 +1030
parents d3b7d4964807
children 5b7d21698a80
line wrap: on
line diff
--- a/syscalls.c	Mon Mar 11 19:52:03 2013 +1030
+++ b/syscalls.c	Tue Mar 26 15:09:46 2013 +1030
@@ -17,8 +17,12 @@
 #include "rtc.h"
 #include "stm32f10x.h" /* for _get_PSP() from core_cm3.h*/
 
-#undef errno
-extern int errno;
+int *
+__errno(void) {
+    static int _errno;
+    
+    return(&errno);
+}
 
 int
 _kill(int pid, int sig) {