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
This commit is contained in:
Brad Fitzpatrick 2014-01-16 14:08:32 -08:00
parent 873aaa59b7
commit 055b588e55
5 changed files with 38 additions and 0 deletions

View File

@ -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),
}
}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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