]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: add Flock on Linux
authorRuss Cox <rsc@golang.org>
Wed, 13 Jul 2011 22:34:36 +0000 (15:34 -0700)
committerRuss Cox <rsc@golang.org>
Wed, 13 Jul 2011 22:34:36 +0000 (15:34 -0700)
Fixes #2069.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4703048

src/pkg/syscall/syscall_linux.go
src/pkg/syscall/zsyscall_linux_386.go
src/pkg/syscall/zsyscall_linux_amd64.go
src/pkg/syscall/zsyscall_linux_arm.go

index 1d6fc76c79d5618eb299c5550392b7c3d2591256..9fc2605c4b21589be2783a79805249bb5c9a2444 100644 (file)
@@ -774,6 +774,7 @@ func ParseDirent(buf []byte, max int, names []string) (consumed int, count int,
 //sys  Fchownat(dirfd int, path string, uid int, gid int, flags int) (errno int)
 //sys  fcntl(fd int, cmd int, arg int) (val int, errno int)
 //sys  Fdatasync(fd int) (errno int)
+//sys  Flock(fd int, how int) (errno int)
 //sys  Fsync(fd int) (errno int)
 //sys  Getdents(fd int, buf []byte) (n int, errno int) = SYS_GETDENTS64
 //sysnb        Getpgid(pid int) (pgid int, errno int)
@@ -878,7 +879,6 @@ func Munmap(b []byte) (errno int) {
 // Fadvise64
 // Fgetxattr
 // Flistxattr
-// Flock
 // Fork
 // Fremovexattr
 // Fsetxattr
index 8df29f1367ca62de961e6948b58d3b5669bace98..4eb522ad922842860485bf1b63c36f78e554a22b 100644 (file)
@@ -277,6 +277,14 @@ func Fdatasync(fd int) (errno int) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
+func Flock(fd int, how int) (errno int) {
+       _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)
+       errno = int(e1)
+       return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
 func Fsync(fd int) (errno int) {
        _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)
        errno = int(e1)
index fa20ff57abc6e177b9519f52edbecd3a18b3f5fa..999ed64a1815eb032057cea52c1b1e2a7f1e5060 100644 (file)
@@ -277,6 +277,14 @@ func Fdatasync(fd int) (errno int) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
+func Flock(fd int, how int) (errno int) {
+       _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)
+       errno = int(e1)
+       return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
 func Fsync(fd int) (errno int) {
        _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)
        errno = int(e1)
index 560a65b12ceed228f89d70ffcecf5ea23f33eab5..cd49dabed6ec8493b17316e00464976e0d821a42 100644 (file)
@@ -277,6 +277,14 @@ func Fdatasync(fd int) (errno int) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
+func Flock(fd int, how int) (errno int) {
+       _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)
+       errno = int(e1)
+       return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
 func Fsync(fd int) (errno int) {
        _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)
        errno = int(e1)