changeset 251 | 1c52a0eeb952 |
parent 242 | 2a9ec03fe5a1 |
child 256 | 6d9efbef00a9 |
250:c040f992052f | 251:1c52a0eeb952 |
---|---|
31 |
31 |
32 func (msghdr *Msghdr) SetControllen(length int) { |
32 func (msghdr *Msghdr) SetControllen(length int) { |
33 msghdr.Controllen = uint32(length) |
33 msghdr.Controllen = uint32(length) |
34 } |
34 } |
35 |
35 |
36 func (msghdr *Msghdr) SetIovlen(length int) { |
|
37 msghdr.Iovlen = int32(length) |
|
38 } |
|
39 |
|
36 func (cmsg *Cmsghdr) SetLen(length int) { |
40 func (cmsg *Cmsghdr) SetLen(length int) { |
37 cmsg.Len = uint32(length) |
41 cmsg.Len = uint32(length) |
38 } |
42 } |
39 |
43 |
40 func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { |
44 func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { |
48 } |
52 } |
49 return |
53 return |
50 } |
54 } |
51 |
55 |
52 func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) |
56 func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) |
57 |
|
58 func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) { |
|
59 ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint64(countin)} |
|
60 err = ptrace(PTRACE_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0) |
|
61 return int(ioDesc.Len), err |
|
62 } |