Merge pull request #940 from Lomanic/issue985

[process][darwin] Fix #925 remove references to removed const unix.SYS___SYSCTL from x/sys/unix
pull/944/head
Lomanic 5 years ago committed by GitHub
commit 8784f48735
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -36,7 +36,7 @@ func CallSyscall(mib []int32) ([]byte, uint64, error) {
// get required buffer size // get required buffer size
length := uint64(0) length := uint64(0)
_, _, err := unix.Syscall6( _, _, err := unix.Syscall6(
unix.SYS___SYSCTL, 202, // unix.SYS___SYSCTL https://github.com/golang/sys/blob/76b94024e4b621e672466e8db3d7f084e7ddcad2/unix/zsysnum_darwin_amd64.go#L146
uintptr(unsafe.Pointer(&mib[0])), uintptr(unsafe.Pointer(&mib[0])),
uintptr(miblen), uintptr(miblen),
0, 0,
@ -54,7 +54,7 @@ func CallSyscall(mib []int32) ([]byte, uint64, error) {
// get proc info itself // get proc info itself
buf := make([]byte, length) buf := make([]byte, length)
_, _, err = unix.Syscall6( _, _, err = unix.Syscall6(
unix.SYS___SYSCTL, 202, // unix.SYS___SYSCTL https://github.com/golang/sys/blob/76b94024e4b621e672466e8db3d7f084e7ddcad2/unix/zsysnum_darwin_amd64.go#L146
uintptr(unsafe.Pointer(&mib[0])), uintptr(unsafe.Pointer(&mib[0])),
uintptr(miblen), uintptr(miblen),
uintptr(unsafe.Pointer(&buf[0])), uintptr(unsafe.Pointer(&buf[0])),

@ -611,7 +611,7 @@ func (p *Process) getKProcWithContext(ctx context.Context) (*KinfoProc, error) {
length := uint64(unsafe.Sizeof(procK)) length := uint64(unsafe.Sizeof(procK))
buf := make([]byte, length) buf := make([]byte, length)
_, _, syserr := unix.Syscall6( _, _, syserr := unix.Syscall6(
unix.SYS___SYSCTL, 202, // unix.SYS___SYSCTL https://github.com/golang/sys/blob/76b94024e4b621e672466e8db3d7f084e7ddcad2/unix/zsysnum_darwin_amd64.go#L146
uintptr(unsafe.Pointer(&mib[0])), uintptr(unsafe.Pointer(&mib[0])),
uintptr(len(mib)), uintptr(len(mib)),
uintptr(unsafe.Pointer(&buf[0])), uintptr(unsafe.Pointer(&buf[0])),

Loading…
Cancel
Save