main
Raw Download raw file
 1//go:build wasip1
 2// +build wasip1
 3
 4package osfs
 5
 6import (
 7	"os"
 8	"syscall"
 9)
10
11func (f *file) Lock() error {
12	f.m.Lock()
13	defer f.m.Unlock()
14	return nil
15}
16
17func (f *file) Unlock() error {
18	f.m.Lock()
19	defer f.m.Unlock()
20	return nil
21}
22
23func rename(from, to string) error {
24	return os.Rename(from, to)
25}
26
27// umask sets umask to a new value, and returns a func which allows the
28// caller to reset it back to what it was originally.
29func umask(new int) func() {
30	old := syscall.Umask(new)
31	return func() {
32		syscall.Umask(old)
33	}
34}