aboutsummaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorAnton Lindqvist <anton@basename.se>2018-12-06 16:57:15 +0100
committerDmitry Vyukov <dvyukov@google.com>2018-12-07 09:45:14 +0100
commitf1c702a86ea52f3d1ec9f4d58153aab2f27f9023 (patch)
treec15f6c7f8f93abedefb13645fc21c1607729b033 /sys
parent8bff832f4890bfc7d18d8bad3259aad938858610 (diff)
sys/targets: some syscalls on OpenBSD does need defines
Some syscalls on OpenBSD violates the ordinary SYS_ prefix convention. This is an exhaustive enumeration of the deviations. Regression introduced in commit 88746fdf ("pkg/csource: use defines from sys/syscall.h on *bsd").
Diffstat (limited to 'sys')
-rw-r--r--sys/targets/targets.go24
1 files changed, 23 insertions, 1 deletions
diff --git a/sys/targets/targets.go b/sys/targets/targets.go
index d33d518c2..36b1840f1 100644
--- a/sys/targets/targets.go
+++ b/sys/targets/targets.go
@@ -196,7 +196,29 @@ var List = map[string]map[string]*Target{
CFlags: []string{"-m64"},
CCompiler: "c++",
CrossCFlags: []string{"-m64", "-static", "-lutil"},
- NeedSyscallDefine: func(uint64) bool {
+ NeedSyscallDefine: func(nr uint64) bool {
+ switch nr {
+ case 8: // SYS___tfork
+ return true
+ case 94: // SYS___thrsleep
+ return true
+ case 198: // SYS___syscall
+ return true
+ case 295: // SYS___semctl
+ return true
+ case 301: // SYS___thrwakeup
+ return true
+ case 302: // SYS___threxit
+ return true
+ case 303: // SYS___thrsigdivert
+ return true
+ case 304: // SYS___getcwd
+ return true
+ case 329: // SYS___set_tcb
+ return true
+ case 330: // SYS___get_tcb
+ return true
+ }
return false
},
},