diff options
| author | Brad Fitzpatrick <bradfitz@golang.org> | 2014-01-16 14:08:32 -0800 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2014-01-16 14:08:32 -0800 |
| commit | 055b588e554ecf6bbf3aff3cdb5e663417ed4df4 (patch) | |
| tree | 82db2bc69e6dcf36387e3dddc38b9f9715d3c925 /src/pkg | |
| parent | 873aaa59b77aaaa35612413f8144176dc1958569 (diff) | |
| download | go-055b588e554ecf6bbf3aff3cdb5e663417ed4df4.tar.xz | |
syscall: add Flock_t on Linux
Matches Darwin and the BSDs. This means leveldb-go, kv,
Camlistore, etc can stop defining these structs on Linux by
hand.
Update #7059
R=golang-codereviews, dave, iant
CC=golang-codereviews
https://golang.org/cl/53350043
Diffstat (limited to 'src/pkg')
| -rw-r--r-- | src/pkg/syscall/consistency_unix_test.go | 10 | ||||
| -rw-r--r-- | src/pkg/syscall/types_linux.go | 2 | ||||
| -rw-r--r-- | src/pkg/syscall/ztypes_linux_386.go | 8 | ||||
| -rw-r--r-- | src/pkg/syscall/ztypes_linux_amd64.go | 10 | ||||
| -rw-r--r-- | src/pkg/syscall/ztypes_linux_arm.go | 8 |
5 files changed, 38 insertions, 0 deletions
diff --git a/src/pkg/syscall/consistency_unix_test.go b/src/pkg/syscall/consistency_unix_test.go index 73630bc614..efab1ee848 100644 --- a/src/pkg/syscall/consistency_unix_test.go +++ b/src/pkg/syscall/consistency_unix_test.go @@ -32,3 +32,13 @@ func _() { _ int = syscall.TCOFLUSH ) } + +func _() { + _ = syscall.Flock_t{ + Type: int16(0), + Whence: int16(0), + Start: 0, + Len: 0, + Pid: int32(0), + } +} diff --git a/src/pkg/syscall/types_linux.go b/src/pkg/syscall/types_linux.go index fea09d1d7f..e8396a41f3 100644 --- a/src/pkg/syscall/types_linux.go +++ b/src/pkg/syscall/types_linux.go @@ -158,6 +158,8 @@ type Dirent C.struct_dirent type Fsid C.fsid_t +type Flock_t C.struct_flock + // Sockets type RawSockaddrInet4 C.struct_sockaddr_in diff --git a/src/pkg/syscall/ztypes_linux_386.go b/src/pkg/syscall/ztypes_linux_386.go index 9abd647acf..daecb1dedc 100644 --- a/src/pkg/syscall/ztypes_linux_386.go +++ b/src/pkg/syscall/ztypes_linux_386.go @@ -142,6 +142,14 @@ type Fsid struct { X__val [2]int32 } +type Flock_t struct { + Type int16 + Whence int16 + Start int64 + Len int64 + Pid int32 +} + type RawSockaddrInet4 struct { Family uint16 Port uint16 diff --git a/src/pkg/syscall/ztypes_linux_amd64.go b/src/pkg/syscall/ztypes_linux_amd64.go index 32da4e4b5c..694fe1eac7 100644 --- a/src/pkg/syscall/ztypes_linux_amd64.go +++ b/src/pkg/syscall/ztypes_linux_amd64.go @@ -142,6 +142,16 @@ type Fsid struct { X__val [2]int32 } +type Flock_t struct { + Type int16 + Whence int16 + Pad_cgo_0 [4]byte + Start int64 + Len int64 + Pid int32 + Pad_cgo_1 [4]byte +} + type RawSockaddrInet4 struct { Family uint16 Port uint16 diff --git a/src/pkg/syscall/ztypes_linux_arm.go b/src/pkg/syscall/ztypes_linux_arm.go index 4a918a8a72..28663e4acd 100644 --- a/src/pkg/syscall/ztypes_linux_arm.go +++ b/src/pkg/syscall/ztypes_linux_arm.go @@ -144,6 +144,14 @@ type Fsid struct { X__val [2]int32 } +type Flock_t struct { + Type int16 + Whence int16 + Start int64 + Len int64 + Pid int32 +} + type RawSockaddrInet4 struct { Family uint16 Port uint16 |
