diff options
| author | ais2397@gmail.com <ais2397@gmail.com> | 2020-04-13 19:43:27 +0530 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-04-13 21:20:21 +0200 |
| commit | a517e13956578261f39f8ef4aee1812d1a882886 (patch) | |
| tree | a7f43521c4954fec1b52bd5e78f65bcfadc8ef3b /sys | |
| parent | 17a986e54c507287c078a70fa9eea0be9f191f84 (diff) | |
sys/netbsd: fix struct stat
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/netbsd/fs.txt | 39 | ||||
| -rw-r--r-- | sys/netbsd/gen/amd64.go | 40 |
2 files changed, 47 insertions, 32 deletions
diff --git a/sys/netbsd/fs.txt b/sys/netbsd/fs.txt index d62027b9b..b68e04fa3 100644 --- a/sys/netbsd/fs.txt +++ b/sys/netbsd/fs.txt @@ -13,6 +13,11 @@ resource pid[int32]: 0, 0xffffffffffffffff resource uid[int32]: 0, 0xffffffffffffffff resource gid[int32]: 0, 0xffffffffffffffff +resource dev[int64]: 0, 0xffffffffffffffff +resource mode[int32]: 0, 0xffffffffffffffff +resource ino[int64]: 0, 0xffffffffffffffff +resource nlink[int32]: 0, 0xffffffffffffffff + open(file ptr[in, filename], flags flags[open_flags], mode flags[open_mode]) fd # Just so that we have something that creates fd_dir resources. open$dir(file ptr[in, filename], flags flags[open_flags], mode flags[open_mode]) fd_dir @@ -47,22 +52,24 @@ iovec_out { } stat { - dev int64 - ino int64 - mode int32 - nlink int32 - rdev int64 - size int64 - blksize int32 - blocks int64 - atime int64 - ansec int64 - mtime int64 - mnsec int64 - ctime int64 - cnsec int64 - pad1 const[0, int32] - pad2 const[0, int32] + dev dev + mode mode + ino ino + nlink nlink + uid uid + gid gid + rdev dev + atim timespec + mtim timespec + ctim timespec + birthtim timespec + size int64 + blocks int64 + blksize int32 + flags int32 + gen int32 + spare1 int32 + spare2 int32 } open_flags = O_RDONLY, O_WRONLY, O_RDWR, O_APPEND, O_CREAT, O_TRUNC, O_EXCL, O_SHLOCK, O_EXLOCK, O_NOFOLLOW, O_CLOEXEC, O_NOSIGPIPE, O_DSYNC, O_SYNC, O_RSYNC, O_ALT_IO, O_NOCTTY, O_DIRECT, O_DIRECTORY, O_ASYNC diff --git a/sys/netbsd/gen/amd64.go b/sys/netbsd/gen/amd64.go index 2a9582b45..0877482d0 100644 --- a/sys/netbsd/gen/amd64.go +++ b/sys/netbsd/gen/amd64.go @@ -12,14 +12,18 @@ func init() { } var resources_amd64 = []*ResourceDesc{ + {Name: "dev", Kind: []string{"dev"}, Values: []uint64{0, 18446744073709551615}}, {Name: "fd", Kind: []string{"fd"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, {Name: "fd_dir", Kind: []string{"fd", "fd_dir"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, {Name: "gid", Kind: []string{"gid"}, Values: []uint64{0, 18446744073709551615}}, + {Name: "ino", Kind: []string{"ino"}, Values: []uint64{0, 18446744073709551615}}, {Name: "ipc", Kind: []string{"ipc"}, Values: []uint64{0, 18446744073709551615}}, {Name: "ipc_msq", Kind: []string{"ipc", "ipc_msq"}, Values: []uint64{0, 18446744073709551615}}, {Name: "ipc_sem", Kind: []string{"ipc", "ipc_sem"}, Values: []uint64{0, 18446744073709551615}}, {Name: "ipc_shm", Kind: []string{"ipc", "ipc_shm"}, Values: []uint64{0, 18446744073709551615}}, {Name: "lwpid", Kind: []string{"lwpid"}, Values: []uint64{0, 18446744073709551615}}, + {Name: "mode", Kind: []string{"mode"}, Values: []uint64{0, 18446744073709551615}}, + {Name: "nlink", Kind: []string{"nlink"}, Values: []uint64{0, 18446744073709551615}}, {Name: "pid", Kind: []string{"pid"}, Values: []uint64{0, 18446744073709551615}}, {Name: "shmaddr", Kind: []string{"shmaddr"}, Values: []uint64{0}}, {Name: "sock", Kind: []string{"fd", "sock"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, @@ -371,24 +375,28 @@ var structDescs_amd64 = []*KeyedStruct{ &FlagsType{IntTypeCommon{TypeCommon: TypeCommon{TypeName: "stack_flags", FldName: "ss_flags", TypeSize: 4}}, []uint64{1, 4}, true}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true}, }}}, - {StructKey{"stat", 1}, &StructDesc{TypeCommon: TypeCommon{TypeName: "stat", TypeSize: 112, ArgDir: 1}, Fields: []Type{ - &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "dev", TypeSize: 8, ArgDir: 1}}}, - &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "ino", TypeSize: 8, ArgDir: 1}}}, - &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "mode", TypeSize: 4, ArgDir: 1}}}, - &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "nlink", TypeSize: 4, ArgDir: 1}}}, - &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "rdev", TypeSize: 8, ArgDir: 1}}}, + {StructKey{"stat", 1}, &StructDesc{TypeCommon: TypeCommon{TypeName: "stat", TypeSize: 152, ArgDir: 1}, Fields: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "dev", FldName: "dev", TypeSize: 8, ArgDir: 1}}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "mode", FldName: "mode", TypeSize: 4, ArgDir: 1}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "ino", FldName: "ino", TypeSize: 8, ArgDir: 1}}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "nlink", FldName: "nlink", TypeSize: 4, ArgDir: 1}}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "uid", FldName: "uid", TypeSize: 4, ArgDir: 1}}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "gid", FldName: "gid", TypeSize: 4, ArgDir: 1}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "dev", FldName: "rdev", TypeSize: 8, ArgDir: 1}}, + &StructType{Key: StructKey{"timespec", 1}, FldName: "atim"}, + &StructType{Key: StructKey{"timespec", 1}, FldName: "mtim"}, + &StructType{Key: StructKey{"timespec", 1}, FldName: "ctim"}, + &StructType{Key: StructKey{"timespec", 1}, FldName: "birthtim"}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "size", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "blocks", TypeSize: 8, ArgDir: 1}}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "blksize", TypeSize: 4, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "flags", TypeSize: 4, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "gen", TypeSize: 4, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "spare1", TypeSize: 4, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "spare2", TypeSize: 4, ArgDir: 1}}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true}, - &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "blocks", TypeSize: 8, ArgDir: 1}}}, - &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "atime", TypeSize: 8, ArgDir: 1}}}, - &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "ansec", TypeSize: 8, ArgDir: 1}}}, - &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "mtime", TypeSize: 8, ArgDir: 1}}}, - &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "mnsec", TypeSize: 8, ArgDir: 1}}}, - &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "ctime", TypeSize: 8, ArgDir: 1}}}, - &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "cnsec", TypeSize: 8, ArgDir: 1}}}, - &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "pad1", TypeSize: 4, ArgDir: 1}}}, - &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "pad2", TypeSize: 4, ArgDir: 1}}}, }}}, {StructKey{"tcp_resources", 1}, &StructDesc{TypeCommon: TypeCommon{TypeName: "tcp_resources", TypeSize: 8, ArgDir: 1}, Fields: []Type{ &ResourceType{TypeCommon: TypeCommon{TypeName: "tcp_seq_num", FldName: "seq", TypeSize: 4, ArgDir: 1}}, @@ -1916,4 +1924,4 @@ var consts_amd64 = []ConstValue{ {"_UC_STACK", 2}, } -const revision_amd64 = "02007478c36366bd9b420e8c59574fd04a9a8014" +const revision_amd64 = "51b70eb87003d3d037d34829e3adcf7145b0cf87" |
