From: Brad Fitzpatrick Date: Thu, 16 Jan 2014 22:08:32 +0000 (-0800) Subject: syscall: add Flock_t on Linux X-Git-Tag: go1.3beta1~951 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=055b588e554ecf6bbf3aff3cdb5e663417ed4df4;p=gostls13.git 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 --- 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