Skip to content

Commit

Permalink
Merge pull request #70 from kuba--/fix-69/illumos
Browse files Browse the repository at this point in the history
Add support for solaris - fix #69
  • Loading branch information
mcuadros authored Jun 30, 2019
2 parents 40f7491 + a72e1d3 commit 63e7cf0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion osfs/os_posix.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build !windows
// +build !windows,!solaris

package osfs

Expand Down
19 changes: 19 additions & 0 deletions osfs/os_solaris.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// +build solaris

package osfs

import "syscall"

func (f *file) Lock() error {
f.m.Lock()
defer f.m.Unlock()

return syscall.Flock(int(f.File.Fd()), syscall.LOCK_EX)
}

func (f *file) Unlock() error {
f.m.Lock()
defer f.m.Unlock()

return syscall.Flock(int(f.File.Fd()), syscall.LOCK_UN)
}

0 comments on commit 63e7cf0

Please sign in to comment.