vendor/golang.org/x/sys/unix/syscall_freebsd_386.go
changeset 272 e9ffa471eeb3
parent 262 8d3354485fc3
child 274 cea6d2f4f728
equal deleted inserted replaced
271:c8b8b7cc8896 272:e9ffa471eeb3
    58 
    58 
    59 func PtraceGetFsBase(pid int, fsbase *int64) (err error) {
    59 func PtraceGetFsBase(pid int, fsbase *int64) (err error) {
    60 	return ptrace(PT_GETFSBASE, pid, uintptr(unsafe.Pointer(fsbase)), 0)
    60 	return ptrace(PT_GETFSBASE, pid, uintptr(unsafe.Pointer(fsbase)), 0)
    61 }
    61 }
    62 
    62 
    63 func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) {
    63 func PtraceIO(req int, pid int, offs uintptr, out []byte, countin int) (count int, err error) {
    64 	ioDesc := PtraceIoDesc{Op: int32(req), Offs: uintptr(unsafe.Pointer(addr)), Addr: uintptr(unsafe.Pointer(&out[0])), Len: uint32(countin)}
    64 	ioDesc := PtraceIoDesc{
       
    65 		Op:   int32(req),
       
    66 		Offs: offs,
       
    67 		Addr: uintptr(unsafe.Pointer(&out[0])), // TODO(#58351): this is not safe.
       
    68 		Len:  uint32(countin),
       
    69 	}
    65 	err = ptrace(PT_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0)
    70 	err = ptrace(PT_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0)
    66 	return int(ioDesc.Len), err
    71 	return int(ioDesc.Len), err
    67 }
    72 }