Skip to content

Commit

Permalink
syscall: remove Flock for aix/ppc64
Browse files Browse the repository at this point in the history
CL 152397 removed it from gc's syscall package.

Updates golang/go#29084

Change-Id: Iac26d912851cdf34c208b9b7eb02b522c085c5ef
Reviewed-on: https://go-review.googlesource.com/c/152557
Reviewed-by: Ian Lance Taylor <iant@golang.org>
  • Loading branch information
tklauser authored and ianlancetaylor committed Dec 5, 2018
1 parent 7259d9a commit d3a98b7
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions libgo/go/syscall/libcall_aix.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,28 +111,6 @@ func Reboot(how int) (err error) {
//sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
//fchownat(dirfd _C_int, path *byte, owner Uid_t, group Gid_t, flags _C_int) _C_int

// On AIX, there is no flock() system call, we emulate it.
func Flock(fd int, op int) (err error) {
lk := &Flock_t{}
if (op & LOCK_UN) != 0 {
lk.Type = F_UNLCK
} else if (op & LOCK_EX) != 0 {
lk.Type = F_WRLCK
} else if (op & LOCK_SH) != 0 {
lk.Type = F_RDLCK
} else {
return nil
}
if (op & LOCK_NB) != 0 {
err = FcntlFlock(uintptr(fd), F_SETLK, lk)
if err != nil && (err == EAGAIN || err == EACCES) {
return EWOULDBLOCK
}
return err
}
return FcntlFlock(uintptr(fd), F_SETLKW, lk)
}

//sys Fstatfs(fd int, buf *Statfs_t) (err error)
//fstatfs64(fd _C_int, buf *Statfs_t) _C_int

Expand Down

0 comments on commit d3a98b7

Please sign in to comment.