]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: add Flock_t on Linux
authorBrad Fitzpatrick <bradfitz@golang.org>
Thu, 16 Jan 2014 22:08:32 +0000 (14:08 -0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 16 Jan 2014 22:08:32 +0000 (14:08 -0800)
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

src/pkg/syscall/consistency_unix_test.go
src/pkg/syscall/types_linux.go
src/pkg/syscall/ztypes_linux_386.go
src/pkg/syscall/ztypes_linux_amd64.go
src/pkg/syscall/ztypes_linux_arm.go

index 73630bc61499fd59457bde13e2cac6d7924af8db..efab1ee84847d141e75707aebf0b105a2411eaf2 100644 (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),
+       }
+}
index fea09d1d7fb72477779d0dff94318de17e07071d..e8396a41f3659fa10864f184c6f80e14e0cfc2d0 100644 (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
index 9abd647acfeebd200e4a3a42c9a9b2af66a62f06..daecb1dedc1832e4061c80796609c0e6fde1520e 100644 (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
index 32da4e4b5cfa78dd2302dd47b44bb5c4dc0c59b7..694fe1eac78718de3ba8ee110c37ec5fe20d07c7 100644 (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
index 4a918a8a72d0d40ebe25f6078a436247d6edb302..28663e4acd3a09e0a08910a0a2f28a4c6044a136 100644 (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