Skip to content

Commit

Permalink
unix: add PthreadChdir and PthreadFchdir on darwin
Browse files Browse the repository at this point in the history
Fixes golang/go#68226

Change-Id: I92052e2319e4edde21b5e1e47ddb5b261d81448a
GitHub-Last-Rev: bc02d6d
GitHub-Pull-Request: #201
Reviewed-on: https://go-review.googlesource.com/c/sys/+/595677
Auto-Submit: Ian Lance Taylor <[email protected]>
Reviewed-by: Cherry Mui <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
  • Loading branch information
espadolini authored and gopherbot committed Jul 3, 2024
1 parent c892bb7 commit faed7ec
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 0 deletions.
2 changes: 2 additions & 0 deletions unix/darwin_amd64_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions unix/darwin_arm64_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions unix/syscall_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,18 @@ func SysctlKinfoProcSlice(name string, args ...int) ([]KinfoProc, error) {
}
}

//sys pthread_chdir_np(path string) (err error)

func PthreadChdir(path string) (err error) {
return pthread_chdir_np(path)
}

//sys pthread_fchdir_np(fd int) (err error)

func PthreadFchdir(fd int) (err error) {
return pthread_fchdir_np(fd)
}

//sys sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error)

//sys shmat(id int, addr uintptr, flag int) (ret uintptr, err error)
Expand Down
33 changes: 33 additions & 0 deletions unix/zsyscall_darwin_amd64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions unix/zsyscall_darwin_amd64.s
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,16 @@ TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0
GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8
DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB)

TEXT libc_pthread_chdir_np_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_pthread_chdir_np(SB)
GLOBL ·libc_pthread_chdir_np_trampoline_addr(SB), RODATA, $8
DATA ·libc_pthread_chdir_np_trampoline_addr(SB)/8, $libc_pthread_chdir_np_trampoline<>(SB)

TEXT libc_pthread_fchdir_np_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_pthread_fchdir_np(SB)
GLOBL ·libc_pthread_fchdir_np_trampoline_addr(SB), RODATA, $8
DATA ·libc_pthread_fchdir_np_trampoline_addr(SB)/8, $libc_pthread_fchdir_np_trampoline<>(SB)

TEXT libc_sendfile_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_sendfile(SB)
GLOBL ·libc_sendfile_trampoline_addr(SB), RODATA, $8
Expand Down
33 changes: 33 additions & 0 deletions unix/zsyscall_darwin_arm64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions unix/zsyscall_darwin_arm64.s
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,16 @@ TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0
GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8
DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB)

TEXT libc_pthread_chdir_np_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_pthread_chdir_np(SB)
GLOBL ·libc_pthread_chdir_np_trampoline_addr(SB), RODATA, $8
DATA ·libc_pthread_chdir_np_trampoline_addr(SB)/8, $libc_pthread_chdir_np_trampoline<>(SB)

TEXT libc_pthread_fchdir_np_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_pthread_fchdir_np(SB)
GLOBL ·libc_pthread_fchdir_np_trampoline_addr(SB), RODATA, $8
DATA ·libc_pthread_fchdir_np_trampoline_addr(SB)/8, $libc_pthread_fchdir_np_trampoline<>(SB)

TEXT libc_sendfile_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_sendfile(SB)
GLOBL ·libc_sendfile_trampoline_addr(SB), RODATA, $8
Expand Down

0 comments on commit faed7ec

Please sign in to comment.