changeset 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 1fdfbad9eca7
children 9456ceea4f07
files syscalls.c
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
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) {