illumos OFD locks.

This commit is contained in:
Nuno Cruces
2023-02-13 13:51:35 +00:00
parent 27081adae2
commit f72c599d2d
2 changed files with 3 additions and 3 deletions

View File

@@ -10,7 +10,7 @@ import (
func Test_vfsLock(t *testing.T) {
// Other OSes lack open file descriptors locks.
switch runtime.GOOS {
case "linux", "darwin", "solaris", "windows":
case "linux", "darwin", "illumos", "windows":
//
default:
t.Skip()

View File

@@ -117,7 +117,7 @@ func (l *vfsFileLocker) fcntlGetLock(lock *syscall.Flock_t) error {
case "darwin":
// https://github.com/apple/darwin-xnu/blob/main/bsd/sys/fcntl.h
F_GETLK = 92 // F_OFD_GETLK
case "solaris":
case "illumos":
// https://github.com/illumos/illumos-gate/blob/master/usr/src/uts/common/sys/fcntl.h
F_GETLK = 47 // F_OFD_GETLK
}
@@ -133,7 +133,7 @@ func (l *vfsFileLocker) fcntlSetLock(lock *syscall.Flock_t) error {
case "darwin":
// https://github.com/apple/darwin-xnu/blob/main/bsd/sys/fcntl.h
F_SETLK = 90 // F_OFD_SETLK
case "solaris":
case "illumos":
// https://github.com/illumos/illumos-gate/blob/master/usr/src/uts/common/sys/fcntl.h
F_SETLK = 48 // F_OFD_SETLK
}