Commit aebfd63c authored by Russ Cox's avatar Russ Cox

syscall: add Flock on Linux

Fixes #2069.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4703048
parent a16baf07
......@@ -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
......
......@@ -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)
......
......@@ -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)
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment