extern size_t strxfrm __P((char *, const char *, size_t));
extern int strcoll __P((const char *s1, const char *s2));
+extern const char *strsignal __P((int s));
+
#ifdef z80
#pagma inline(memcpy)
#pagma inline(memset)
LINKER = sdldz80
# This gets set for 'awkward' devices like ZX128
#PLATFORM = -zx128
-#PLATFORM =
+PLATFORM =
export PLATFORM
#CC_OPT = -mz80 -c --opt-code-size --std-c99 --max-allocs-per-node 2000000 -I../include
CC_OPT = -mz80 --std-c99 -c --opt-code-size --max-allocs-per-node 20000 -I../include
SRC_C += setlocale.c setvbuf.c settimeofday.c sleep.c sprintf.c
SRC_C += stat.c stdio0.c stime.c
SRC_C += strcasecmp.c strcasestr.c strdup.c stricmp.c strlcpy.c strncasecmp.c
-SRC_C += strnlen.c strnicmp.c strsep.c strxfrm.c strcoll.c
+SRC_C += strnlen.c strnicmp.c strsep.c strxfrm.c strcoll.c strsignal.c
SRC_C += strtod.c strtol.c system.c time.c tmpfile.c tmpnam.c ttyname.c
SRC_C += tzset.c ungetc.c utent.c utimes.c utsname.c
SRC_C += vfprintf.c vprintf.c wait.c xitoa.c pathconf.c
SRC_C += setlocale.c setvbuf.c settimeofday.c sleep.c sprintf.c
SRC_C += stat.c stdio0.c stime.c
SRC_C += strcasecmp.c strcasestr.c strdup.c stricmp.c strlcpy.c strncasecmp.c
-SRC_C += strnicmp.c strnlen.c strsep.c
+SRC_C += strnicmp.c strnlen.c strsep.c strsignal.c
SRC_C += system.c time.c tmpfile.c tmpnam.c ttyname.c
SRC_C += tzset.c ungetc.c utent.c utimes.c utsname.c
SRC_C += vfprintf.c vprintf.c wait.c xitoa.c pathconf.c
syslib.lib: fuzix6502/Makefile $(OBJ_C)
(cd fuzix6502; make)
$(AR) a syslib.lib $(OBJ_C)
- ln -sf syslib.lib c.lib
+ ln -sf syslib.lib c6502.lib
$(OBJ_ASM):%.o: %.s
$(ASM) $(ASM_OPT) $@ $(@:.o=.s)
SRC_C += setlocale.c setvbuf.c settimeofday.c sleep.c sprintf.c
SRC_C += stat.c stdio0.c stime.c
SRC_C += strcasecmp.c strcasestr.c strdup.c stricmp.c strlcpy.c strncasecmp.c
-SRC_C += strnlen.c strnicmp.c strsep.c strxfrm.c strcoll.c
+SRC_C += strnlen.c strnicmp.c strsep.c strsignal.c strxfrm.c strcoll.c
SRC_C += strtod.c strtol.c system.c time.c tmpfile.c tmpnam.c ttyname.c
SRC_C += tzset.c ungetc.c utent.c utimes.c utsname.c
SRC_C += vfprintf.c vprintf.c wait.c xitoa.c pathconf.c
--- /dev/null
+/*
+ * Implement strsignal and the C sys_siglist
+ */
+
+#include <string.h>
+#include <unistd.h>
+
+const char *sys_siglist[NSIGS] = {
+ "Unknown signal",
+ "Hangup",
+ "Interrupt",
+ "Quit",
+ "Illegal instruction",
+ "BPT trace/trap",
+ "ABORT instruction",
+ "I/O trap",
+ "Bus error",
+ "Floating point exception",
+ "Killed",
+ "User signal 1",
+ "User signal 2",
+ "Broken pipe",
+ "Alarm clock",
+ "Terminated",
+ "Stack fault",
+ "Child death or stop",
+ "Continue",
+ "Stopped",
+ "Stopped (signal)",
+ "Stopped (tty input)",
+ "Stopped (tty output)",
+ "Urgent IO condition",
+ "CPU limit",
+ "File limit",
+ "Alarm (virtual)",
+ "Alarm (profile)",
+ "Window changed",
+ "I/O ready",
+ "Power",
+ "Bad system call"
+};
+
+const char *strsignal(int s)
+{
+ if (s < 1 || s >= NSIGS)
+ s = 0;
+ return sys_siglist[s];
+}