Skip to content

Commit 63e7cf0

Browse files
authored
Merge pull request #70 from kuba--/fix-69/illumos
Add support for solaris - fix #69
2 parents 40f7491 + a72e1d3 commit 63e7cf0

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

osfs/os_posix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// +build !windows
1+
// +build !windows,!solaris
22

33
package osfs
44

osfs/os_solaris.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// +build solaris
2+
3+
package osfs
4+
5+
import "syscall"
6+
7+
func (f *file) Lock() error {
8+
f.m.Lock()
9+
defer f.m.Unlock()
10+
11+
return syscall.Flock(int(f.File.Fd()), syscall.LOCK_EX)
12+
}
13+
14+
func (f *file) Unlock() error {
15+
f.m.Lock()
16+
defer f.m.Unlock()
17+
18+
return syscall.Flock(int(f.File.Fd()), syscall.LOCK_UN)
19+
}

0 commit comments

Comments
 (0)