Skip to content

Commit

Permalink
unix: add PthreadChdir and PthreadFchdir on darwin
Browse files Browse the repository at this point in the history
  • Loading branch information
espadolini committed Jun 27, 2024
1 parent c892bb7 commit a14d2c6
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(path string) (err error)

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

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

func PthreadFchdir(fd int) (err error) {
return __pthread_fchdir(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_trampoline<>(SB),NOSPLIT,$0-0
JMP libc___pthread_chdir(SB)
GLOBL ·libc___pthread_chdir_trampoline_addr(SB), RODATA, $8
DATA ·libc___pthread_chdir_trampoline_addr(SB)/8, $libc___pthread_chdir_trampoline<>(SB)

TEXT libc___pthread_fchdir_trampoline<>(SB),NOSPLIT,$0-0
JMP libc___pthread_fchdir(SB)
GLOBL ·libc___pthread_fchdir_trampoline_addr(SB), RODATA, $8
DATA ·libc___pthread_fchdir_trampoline_addr(SB)/8, $libc___pthread_fchdir_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_trampoline<>(SB),NOSPLIT,$0-0
JMP libc___pthread_chdir(SB)
GLOBL ·libc___pthread_chdir_trampoline_addr(SB), RODATA, $8
DATA ·libc___pthread_chdir_trampoline_addr(SB)/8, $libc___pthread_chdir_trampoline<>(SB)

TEXT libc___pthread_fchdir_trampoline<>(SB),NOSPLIT,$0-0
JMP libc___pthread_fchdir(SB)
GLOBL ·libc___pthread_fchdir_trampoline_addr(SB), RODATA, $8
DATA ·libc___pthread_fchdir_trampoline_addr(SB)/8, $libc___pthread_fchdir_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 a14d2c6

Please sign in to comment.