1
0
mirror of https://github.com/golang/go synced 2024-11-24 18:10:02 -07:00

syscall: add Flock on Linux

Fixes #2069.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4703048
This commit is contained in:
Russ Cox 2011-07-13 15:34:36 -07:00
parent a16baf0777
commit aebfd63cd9
4 changed files with 25 additions and 1 deletions

View 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

View 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)

View 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)

View 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)