aboutsummaryrefslogtreecommitdiffstats
path: root/sys/netbsd
diff options
context:
space:
mode:
authorSiddharth Muralee <siddharth.muralee@gmail.com>2019-12-04 15:27:22 +0000
committerDmitry Vyukov <dvyukov@google.com>2019-12-05 10:06:13 +0100
commit9fd5a512f39cdc0ec154632d7165855c9dfb3390 (patch)
tree9f0e8d8345ddd3dbdc8e19f297dbf87a5ea902ee /sys/netbsd
parentb91ea9289b58ea7b5611dde484a96d97ee086121 (diff)
sys/netbsd: fix the build issues with posix_spawn
Diffstat (limited to 'sys/netbsd')
-rw-r--r--sys/netbsd/gen/amd64.go32
-rw-r--r--sys/netbsd/sys.txt13
-rw-r--r--sys/netbsd/sys_amd64.const3
3 files changed, 33 insertions, 15 deletions
diff --git a/sys/netbsd/gen/amd64.go b/sys/netbsd/gen/amd64.go
index 76ebb84ad..fbfdbc126 100644
--- a/sys/netbsd/gen/amd64.go
+++ b/sys/netbsd/gen/amd64.go
@@ -59,10 +59,6 @@ var structDescs_amd64 = []*KeyedStruct{
{Key: StructKey{Name: "dup2_t"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "dup2_t", TypeSize: 4}, Fields: []Type{
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "newfildes", TypeSize: 4}}},
}}},
- {Key: StructKey{Name: "fae_data_t"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "fae_data_t", TypeSize: 16}, Fields: []Type{
- &StructType{Key: StructKey{Name: "open_t"}, FldName: "open"},
- &StructType{Key: StructKey{Name: "dup2_t"}, FldName: "dup2"},
- }}},
{Key: StructKey{Name: "fd_set", Dir: 2}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "fd_set", TypeSize: 64, ArgDir: 2}, Fields: []Type{
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "mask0", TypeSize: 8, ArgDir: 2}}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "mask1", TypeSize: 8, ArgDir: 2}}},
@@ -192,12 +188,27 @@ var structDescs_amd64 = []*KeyedStruct{
{Key: StructKey{Name: "posix_spawn_file_actions"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "posix_spawn_file_actions", TypeSize: 16}, Fields: []Type{
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "size", TypeSize: 4}}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "len", TypeSize: 4}}},
- &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "fae", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "posix_spawn_file_actions_entry"}}},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "fae", TypeSize: 8}, Type: &UnionType{Key: StructKey{Name: "posix_spawn_file_actions_entry"}}},
}}},
{Key: StructKey{Name: "posix_spawn_file_actions_entry"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "posix_spawn_file_actions_entry", TypeSize: 24}, Fields: []Type{
- &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "fae_action", TypeSize: 4}}},
- &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "fae_filedes", TypeSize: 4}}},
- &UnionType{Key: StructKey{Name: "fae_data_t"}, FldName: "fae_data"},
+ &StructType{Key: StructKey{Name: "posix_spawn_file_actions_entry_t[FAE_OPEN, fd, open_t]"}, FldName: "open"},
+ &StructType{Key: StructKey{Name: "posix_spawn_file_actions_entry_t[FAE_DUP2, fd, dup2_t]"}, FldName: "dup"},
+ &StructType{Key: StructKey{Name: "posix_spawn_file_actions_entry_t[FAE_CLOSE, fd, void]"}, FldName: "close"},
+ }}},
+ {Key: StructKey{Name: "posix_spawn_file_actions_entry_t[FAE_CLOSE, fd, void]"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "posix_spawn_file_actions_entry_t[FAE_CLOSE, fd, void]", TypeSize: 8}, Fields: []Type{
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "fae_action", TypeSize: 4}}, Val: 2},
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fae_filedes", TypeSize: 4}},
+ &BufferType{TypeCommon: TypeCommon{TypeName: "void", FldName: "fae_data"}, Kind: 1},
+ }}},
+ {Key: StructKey{Name: "posix_spawn_file_actions_entry_t[FAE_DUP2, fd, dup2_t]"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "posix_spawn_file_actions_entry_t[FAE_DUP2, fd, dup2_t]", TypeSize: 12}, Fields: []Type{
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "fae_action", TypeSize: 4}}, Val: 1},
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fae_filedes", TypeSize: 4}},
+ &StructType{Key: StructKey{Name: "dup2_t"}, FldName: "fae_data"},
+ }}},
+ {Key: StructKey{Name: "posix_spawn_file_actions_entry_t[FAE_OPEN, fd, open_t]"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "posix_spawn_file_actions_entry_t[FAE_OPEN, fd, open_t]", TypeSize: 24}, Fields: []Type{
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "fae_action", TypeSize: 4}}},
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fae_filedes", TypeSize: 4}},
+ &StructType{Key: StructKey{Name: "open_t"}, FldName: "fae_data"},
}}},
{Key: StructKey{Name: "posix_spawnattr"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "posix_spawnattr", TypeSize: 48}, Fields: []Type{
&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "sa_flags", FldName: "sa_flags", TypeSize: 2}}, Vals: []uint64{1, 2, 4, 16, 8, 32, 64, 128, 255}},
@@ -1482,6 +1493,9 @@ var consts_amd64 = []ConstValue{
{Name: "CLONE_SIGHAND", Value: 2048},
{Name: "CLONE_VFORK", Value: 16384},
{Name: "CLONE_VM", Value: 256},
+ {Name: "FAE_CLOSE", Value: 2},
+ {Name: "FAE_DUP2", Value: 1},
+ {Name: "FAE_OPEN"},
{Name: "FD_CLOEXEC", Value: 1},
{Name: "F_DUPFD"},
{Name: "F_DUPFD_CLOEXEC", Value: 12},
@@ -1868,4 +1882,4 @@ var consts_amd64 = []ConstValue{
{Name: "_UC_STACK", Value: 2},
}
-const revision_amd64 = "75190c0fbdcd19c01861cd8fa231f6941769dfed"
+const revision_amd64 = "f31cb43d193657198cdbdaaf2f2e31a81921803d"
diff --git a/sys/netbsd/sys.txt b/sys/netbsd/sys.txt
index 133de0c14..06ef8ac82 100644
--- a/sys/netbsd/sys.txt
+++ b/sys/netbsd/sys.txt
@@ -18,6 +18,7 @@ include <sys/wait.h>
include <sys/ptrace.h>
include <sys/sched.h>
include <sys/signal.h>
+include <sys/spawn.h>
syz_execute_func(text ptr[in, text[target]])
@@ -202,15 +203,15 @@ posix_spawn_file_actions {
}
posix_spawn_file_actions_entry [
- open posix_spawn_file_actions_entry_t[FAE_OPEN, fd, open_t]
- dup posix_spawn_file_actions_entry_t[FAE_DUP2, fd, dup2_t]
- close posix_spawn_file_actions_entry_t[FAE_CLOSE, fd, void]
+ open posix_spawn_file_actions_entry_t[FAE_OPEN, fd, open_t]
+ dup posix_spawn_file_actions_entry_t[FAE_DUP2, fd, dup2_t]
+ close posix_spawn_file_actions_entry_t[FAE_CLOSE, fd, void]
]
type posix_spawn_file_actions_entry_t[ACTION, FILEDES, DATA] {
- fae_action const[ACTION, int32]
- fae_filedes FILEDES
- fae_data DATA
+ fae_action const[ACTION, int32]
+ fae_filedes FILEDES
+ fae_data DATA
}
open_t {
diff --git a/sys/netbsd/sys_amd64.const b/sys/netbsd/sys_amd64.const
index 09b227102..e783d58cc 100644
--- a/sys/netbsd/sys_amd64.const
+++ b/sys/netbsd/sys_amd64.const
@@ -17,6 +17,9 @@ CLONE_PTRACE = 8192
CLONE_SIGHAND = 2048
CLONE_VFORK = 16384
CLONE_VM = 256
+FAE_CLOSE = 2
+FAE_DUP2 = 1
+FAE_OPEN = 0
FD_CLOEXEC = 1
F_DUPFD = 0
F_DUPFD_CLOEXEC = 12