diff --git a/platform/galileo/Makefile.galileo b/platform/galileo/Makefile.galileo index 9aca3d0a8..a1429b398 100644 --- a/platform/galileo/Makefile.galileo +++ b/platform/galileo/Makefile.galileo @@ -12,7 +12,7 @@ PROJECT_SOURCEFILES += newlib-syscalls.c CONTIKI_CPU=$(CONTIKI)/cpu/x86 include $(CONTIKI)/cpu/x86/Makefile.x86_quarkX1000 -CFLAGS += -fno-stack-protector -nostdinc -isystem $(LIBC)/include -isystem $(LIBGCC_PATH)/include -isystem $(LIBGCC_PATH)/include-fixed +CFLAGS += -fno-stack-protector -nostdinc -I$(LIBC)/include -isystem $(LIBGCC_PATH)/include -isystem $(LIBGCC_PATH)/include-fixed LDFLAGS += -nostdlib -L$(LIBC)/lib -L$(LIBGCC_PATH)/32 TARGET_LIBFILES += -lm -lc -lgcc diff --git a/platform/galileo/newlib-syscalls.c b/platform/galileo/newlib-syscalls.c index 8032e6da8..fa098c6eb 100644 --- a/platform/galileo/newlib-syscalls.c +++ b/platform/galileo/newlib-syscalls.c @@ -32,6 +32,7 @@ #include #include "uart.h" +#include "helpers.h" #define CONSOLE_OUTPUT_DEV QUARK_X1000_UART_1 @@ -48,19 +49,42 @@ _close_r(struct _reent *ptr, int file) return -1; } /*---------------------------------------------------------------------------*/ +void +_exit(int status) +{ + halt(); +} +/*---------------------------------------------------------------------------*/ +int +_getpid_r(struct _reent *ptr) +{ + /* Stubbed function */ + ptr->_errno = ENOTSUP; + return -1; +} +/*---------------------------------------------------------------------------*/ int _isatty_r(struct _reent *ptr, int file) { /* Stubbed function */ + ptr->_errno = ENOTSUP; return 0; } /*---------------------------------------------------------------------------*/ int +_kill_r(struct _reent *ptr, int pid, int signal) +{ + /* Stubbed function */ + ptr->_errno = ENOTSUP; + return -1; +} +/*---------------------------------------------------------------------------*/ +int _read_r(struct _reent *ptr, int file, char *buf, int len) { /* Stubbed function */ ptr->_errno = ENOTSUP; - return 0; + return -1; } /*---------------------------------------------------------------------------*/ int @@ -107,7 +131,7 @@ _lseek_r(struct _reent *ptr, int file, int p, int dir) { /* Stubbed function */ ptr->_errno = ENOTSUP; - return 0; + return -1; } /*---------------------------------------------------------------------------*/ int