ref: 1c2826a8e5a78c85eea6bd234ff384241b2dc3db
parent: 7e1d196fa2b2496328632d515a3205004a5cefaf
author: Roberto E. Vargas Caballero <[email protected]>
date: Wed Aug 29 16:09:33 EDT 2018
[lib/c] Fix signal implementation for NetBSD The definition of struct sigaction was wrong and sa_flags was in a wrong offset.
--- a/lib/c/target/amd64-sysv-netbsd/Makefile
+++ b/lib/c/target/amd64-sysv-netbsd/Makefile
@@ -5,7 +5,7 @@
SYSNAME = amd64-sysv-netbsd
SCC_CFLAGS = -static -nostdinc -I$(INCDIR) -I$(INCDIR)/bits/amd64-sysv/ -I.
-SYSOBJ = raise.o signal.o
+SYSOBJ = raise.o signal.o _sigaction.o _sigaction2.o _setcontext.o
include syscall.mk
include ../script/objlst.mk
--- a/lib/c/target/amd64-sysv-netbsd/sys.h
+++ b/lib/c/target/amd64-sysv-netbsd/sys.h
@@ -11,7 +11,7 @@
struct sigaction {
void (*sa_handler)(int);
- int sa_mask;
+ char sa_mask[8];
int sa_flags;
};
--- a/lib/c/target/amd64-sysv-netbsd/syscall.lst
+++ b/lib/c/target/amd64-sysv-netbsd/syscall.lst
@@ -8,4 +8,3 @@
20 _getpid
37 _kill
199 _lseek
-340 _sigaction
--- a/lib/c/target/amd64-sysv-netbsd/syscall.mk
+++ b/lib/c/target/amd64-sysv-netbsd/syscall.mk
@@ -1,1 +1,1 @@
-SYSCALL = _Exit.o _read.o _write.o _open.o _close.o _brk.o _getpid.o _kill.o _sigaction.o _lseek.o
+SYSCALL = _Exit.o _read.o _write.o _open.o _close.o _brk.o _getpid.o _kill.o _lseek.o
--- a/lib/c/target/posix/signal.c
+++ b/lib/c/target/posix/signal.c
@@ -12,7 +12,6 @@
{
struct sigaction sa = {
.sa_handler = func,
- .sa_flags = 0,
};
if (_sigaction(signum, &sa, &sa) < 0)
--- a/tests/libc/execute/libc-tests.lst
+++ b/tests/libc/execute/libc-tests.lst
@@ -1,1 +1,1 @@
-0001-abort.c [TODO]
+0001-abort.c