Skip to content

Commit faed7ec

Browse files
espadolinigopherbot
authored andcommitted
unix: add PthreadChdir and PthreadFchdir on darwin
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]>
1 parent c892bb7 commit faed7ec

7 files changed

+102
-0
lines changed

unix/darwin_amd64_test.go

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unix/darwin_arm64_test.go

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unix/syscall_darwin.go

+12
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,18 @@ func SysctlKinfoProcSlice(name string, args ...int) ([]KinfoProc, error) {
542542
}
543543
}
544544

545+
//sys pthread_chdir_np(path string) (err error)
546+
547+
func PthreadChdir(path string) (err error) {
548+
return pthread_chdir_np(path)
549+
}
550+
551+
//sys pthread_fchdir_np(fd int) (err error)
552+
553+
func PthreadFchdir(fd int) (err error) {
554+
return pthread_fchdir_np(fd)
555+
}
556+
545557
//sys sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error)
546558

547559
//sys shmat(id int, addr uintptr, flag int) (ret uintptr, err error)

unix/zsyscall_darwin_amd64.go

+33
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unix/zsyscall_darwin_amd64.s

+10
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,16 @@ TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0
228228
GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8
229229
DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB)
230230

231+
TEXT libc_pthread_chdir_np_trampoline<>(SB),NOSPLIT,$0-0
232+
JMP libc_pthread_chdir_np(SB)
233+
GLOBL ·libc_pthread_chdir_np_trampoline_addr(SB), RODATA, $8
234+
DATA ·libc_pthread_chdir_np_trampoline_addr(SB)/8, $libc_pthread_chdir_np_trampoline<>(SB)
235+
236+
TEXT libc_pthread_fchdir_np_trampoline<>(SB),NOSPLIT,$0-0
237+
JMP libc_pthread_fchdir_np(SB)
238+
GLOBL ·libc_pthread_fchdir_np_trampoline_addr(SB), RODATA, $8
239+
DATA ·libc_pthread_fchdir_np_trampoline_addr(SB)/8, $libc_pthread_fchdir_np_trampoline<>(SB)
240+
231241
TEXT libc_sendfile_trampoline<>(SB),NOSPLIT,$0-0
232242
JMP libc_sendfile(SB)
233243
GLOBL ·libc_sendfile_trampoline_addr(SB), RODATA, $8

unix/zsyscall_darwin_arm64.go

+33
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unix/zsyscall_darwin_arm64.s

+10
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,16 @@ TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0
228228
GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8
229229
DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB)
230230

231+
TEXT libc_pthread_chdir_np_trampoline<>(SB),NOSPLIT,$0-0
232+
JMP libc_pthread_chdir_np(SB)
233+
GLOBL ·libc_pthread_chdir_np_trampoline_addr(SB), RODATA, $8
234+
DATA ·libc_pthread_chdir_np_trampoline_addr(SB)/8, $libc_pthread_chdir_np_trampoline<>(SB)
235+
236+
TEXT libc_pthread_fchdir_np_trampoline<>(SB),NOSPLIT,$0-0
237+
JMP libc_pthread_fchdir_np(SB)
238+
GLOBL ·libc_pthread_fchdir_np_trampoline_addr(SB), RODATA, $8
239+
DATA ·libc_pthread_fchdir_np_trampoline_addr(SB)/8, $libc_pthread_fchdir_np_trampoline<>(SB)
240+
231241
TEXT libc_sendfile_trampoline<>(SB),NOSPLIT,$0-0
232242
JMP libc_sendfile(SB)
233243
GLOBL ·libc_sendfile_trampoline_addr(SB), RODATA, $8

0 commit comments

Comments
 (0)