mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-01 06:46:44 -04:00
unix: add PthreadChdir and PthreadFchdir on darwin
Fixes golang/go#68226 Change-Id: I92052e2319e4edde21b5e1e47ddb5b261d81448a GitHub-Last-Rev: bc02d6d44bb64ad202c97d3525d5355e8a027a5e GitHub-Pull-Request: golang/sys#201 Reviewed-on: https://go-review.googlesource.com/c/sys/+/595677 Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
committed by
Gopher Robot
parent
c892bb7ec2
commit
faed7ec264
@@ -101,6 +101,8 @@ var darwinTests = [...]darwinTest{
|
|||||||
{"pipe", libc_pipe_trampoline_addr},
|
{"pipe", libc_pipe_trampoline_addr},
|
||||||
{"poll", libc_poll_trampoline_addr},
|
{"poll", libc_poll_trampoline_addr},
|
||||||
{"pread", libc_pread_trampoline_addr},
|
{"pread", libc_pread_trampoline_addr},
|
||||||
|
{"pthread_chdir_np", libc_pthread_chdir_np_trampoline_addr},
|
||||||
|
{"pthread_fchdir_np", libc_pthread_fchdir_np_trampoline_addr},
|
||||||
{"ptrace", libc_ptrace_trampoline_addr},
|
{"ptrace", libc_ptrace_trampoline_addr},
|
||||||
{"pwrite", libc_pwrite_trampoline_addr},
|
{"pwrite", libc_pwrite_trampoline_addr},
|
||||||
{"read", libc_read_trampoline_addr},
|
{"read", libc_read_trampoline_addr},
|
||||||
|
|||||||
@@ -101,6 +101,8 @@ var darwinTests = [...]darwinTest{
|
|||||||
{"pipe", libc_pipe_trampoline_addr},
|
{"pipe", libc_pipe_trampoline_addr},
|
||||||
{"poll", libc_poll_trampoline_addr},
|
{"poll", libc_poll_trampoline_addr},
|
||||||
{"pread", libc_pread_trampoline_addr},
|
{"pread", libc_pread_trampoline_addr},
|
||||||
|
{"pthread_chdir_np", libc_pthread_chdir_np_trampoline_addr},
|
||||||
|
{"pthread_fchdir_np", libc_pthread_fchdir_np_trampoline_addr},
|
||||||
{"ptrace", libc_ptrace_trampoline_addr},
|
{"ptrace", libc_ptrace_trampoline_addr},
|
||||||
{"pwrite", libc_pwrite_trampoline_addr},
|
{"pwrite", libc_pwrite_trampoline_addr},
|
||||||
{"read", libc_read_trampoline_addr},
|
{"read", libc_read_trampoline_addr},
|
||||||
|
|||||||
@@ -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 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)
|
//sys shmat(id int, addr uintptr, flag int) (ret uintptr, err error)
|
||||||
|
|||||||
@@ -760,6 +760,39 @@ var libc_sysctl_trampoline_addr uintptr
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func pthread_chdir_np(path string) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := syscall_syscall(libc_pthread_chdir_np_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var libc_pthread_chdir_np_trampoline_addr uintptr
|
||||||
|
|
||||||
|
//go:cgo_import_dynamic libc_pthread_chdir_np pthread_chdir_np "/usr/lib/libSystem.B.dylib"
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func pthread_fchdir_np(fd int) (err error) {
|
||||||
|
_, _, e1 := syscall_syscall(libc_pthread_fchdir_np_trampoline_addr, uintptr(fd), 0, 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var libc_pthread_fchdir_np_trampoline_addr uintptr
|
||||||
|
|
||||||
|
//go:cgo_import_dynamic libc_pthread_fchdir_np pthread_fchdir_np "/usr/lib/libSystem.B.dylib"
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) {
|
func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) {
|
||||||
_, _, e1 := syscall_syscall6(libc_sendfile_trampoline_addr, uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags))
|
_, _, e1 := syscall_syscall6(libc_sendfile_trampoline_addr, uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags))
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
|
|||||||
@@ -228,6 +228,16 @@ TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0
|
|||||||
GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8
|
GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8
|
||||||
DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB)
|
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
|
TEXT libc_sendfile_trampoline<>(SB),NOSPLIT,$0-0
|
||||||
JMP libc_sendfile(SB)
|
JMP libc_sendfile(SB)
|
||||||
GLOBL ·libc_sendfile_trampoline_addr(SB), RODATA, $8
|
GLOBL ·libc_sendfile_trampoline_addr(SB), RODATA, $8
|
||||||
|
|||||||
@@ -760,6 +760,39 @@ var libc_sysctl_trampoline_addr uintptr
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func pthread_chdir_np(path string) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := syscall_syscall(libc_pthread_chdir_np_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var libc_pthread_chdir_np_trampoline_addr uintptr
|
||||||
|
|
||||||
|
//go:cgo_import_dynamic libc_pthread_chdir_np pthread_chdir_np "/usr/lib/libSystem.B.dylib"
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func pthread_fchdir_np(fd int) (err error) {
|
||||||
|
_, _, e1 := syscall_syscall(libc_pthread_fchdir_np_trampoline_addr, uintptr(fd), 0, 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var libc_pthread_fchdir_np_trampoline_addr uintptr
|
||||||
|
|
||||||
|
//go:cgo_import_dynamic libc_pthread_fchdir_np pthread_fchdir_np "/usr/lib/libSystem.B.dylib"
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) {
|
func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) {
|
||||||
_, _, e1 := syscall_syscall6(libc_sendfile_trampoline_addr, uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags))
|
_, _, e1 := syscall_syscall6(libc_sendfile_trampoline_addr, uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags))
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
|
|||||||
@@ -228,6 +228,16 @@ TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0
|
|||||||
GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8
|
GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8
|
||||||
DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB)
|
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
|
TEXT libc_sendfile_trampoline<>(SB),NOSPLIT,$0-0
|
||||||
JMP libc_sendfile(SB)
|
JMP libc_sendfile(SB)
|
||||||
GLOBL ·libc_sendfile_trampoline_addr(SB), RODATA, $8
|
GLOBL ·libc_sendfile_trampoline_addr(SB), RODATA, $8
|
||||||
|
|||||||
Reference in New Issue
Block a user