Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions src/syscall/syscall_libc.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,24 +125,6 @@ func Unlink(path string) (err error) {
return
}

func Chown(path string, uid, gid int) (err error) {
data := cstring(path)
fail := int(libc_chown(&data[0], uid, gid))
if fail < 0 {
err = getErrno()
}
return
}

func Lchown(path string, uid, gid int) (err error) {
data := cstring(path)
fail := int(libc_lchown(&data[0], uid, gid))
if fail < 0 {
err = getErrno()
}
return
}

func Fork() (err error) {
fail := int(libc_fork())
if fail < 0 {
Expand Down Expand Up @@ -329,16 +311,6 @@ func libc_chdir(pathname *byte) int32
//export chmod
func libc_chmod(pathname *byte, mode uint32) int32

// int chown(const char *pathname, uid_t owner, gid_t group);
//
//export chown
func libc_chown(pathname *byte, owner, group int) int32

// int lchown(const char *pathname, uid_t owner, gid_t group);
//
//export lchown
func libc_lchown(pathname *byte, owner, group int) int32

// int mkdir(const char *pathname, mode_t mode);
//
//export mkdir
Expand Down
24 changes: 24 additions & 0 deletions src/syscall/syscall_libc_nintendoswitch.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,30 @@ var signals = [...]string{}

// File system

func Chown(path string, uid, gid int) (err error) {
data := cstring(path)
fail := int(libc_chown(&data[0], uid, gid))
if fail < 0 {
err = getErrno()
}
return
}

func Lchown(path string, uid, gid int) (err error) {
data := cstring(path)
fail := int(libc_lchown(&data[0], uid, gid))
if fail < 0 {
err = getErrno()
}
return
}

//export chown
func libc_chown(pathname *byte, owner, group int) int32

//export lchown
func libc_lchown(pathname *byte, owner, group int) int32

const (
Stdin = 0
Stdout = 1
Expand Down
13 changes: 13 additions & 0 deletions src/syscall/syscall_libc_wasi.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,19 @@ func Chmod(path string, mode uint32) (err error) {
return Lstat(path, &stat)
}

// WASI has no ownership operations. Match Go's syscall/fs_wasip1.go.
func Chown(path string, uid, gid int) error {
return ENOSYS
}

func Fchown(fd int, uid, gid int) error {
return ENOSYS
}

func Lchown(path string, uid, gid int) error {
return ENOSYS
}

// TODO: should this return runtime.wasmPageSize?
func Getpagesize() int {
return libc_getpagesize()
Expand Down
Loading