return;
}
+func ptrace(request int, pid int, addr uintptr, data uintptr) (errno int) {
+ r0, r1, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0);
+ errno = int(e1);
+ return;
+}
+
func Access(path string, mode int) (errno int) {
r0, r1, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0);
errno = int(e1);
WSTOPPED = 0x2;
WCONTINUED = 0x8;
WNOWAIT = 0x1000000;
+ WCLONE = 0x80000000;
+ WALL = 0x40000000;
+ WNOTHREAD = 0x20000000;
AF_UNIX = 0x1;
AF_INET = 0x2;
AF_INET6 = 0xa;
SizeofSockaddrInet6 = 0x1c;
SizeofSockaddrAny = 0x1c;
SizeofSockaddrUnix = 0x6e;
+ _PTRACE_TRACEME = 0;
+ _PTRACE_PEEKTEXT = 0x1;
+ _PTRACE_PEEKDATA = 0x2;
+ _PTRACE_PEEKUSER = 0x3;
+ _PTRACE_POKETEXT = 0x4;
+ _PTRACE_POKEDATA = 0x5;
+ _PTRACE_POKEUSER = 0x6;
+ _PTRACE_CONT = 0x7;
+ _PTRACE_KILL = 0x8;
+ _PTRACE_SINGLESTEP = 0x9;
+ _PTRACE_GETREGS = 0xc;
+ _PTRACE_SETREGS = 0xd;
+ _PTRACE_GETFPREGS = 0xe;
+ _PTRACE_SETFPREGS = 0xf;
+ _PTRACE_ATTACH = 0x10;
+ _PTRACE_DETACH = 0x11;
+ _PTRACE_GETFPXREGS = 0x12;
+ _PTRACE_SETFPXREGS = 0x13;
+ _PTRACE_SYSCALL = 0x18;
+ _PTRACE_SETOPTIONS = 0x4200;
+ _PTRACE_GETEVENTMSG = 0x4201;
+ _PTRACE_GETSIGINFO = 0x4202;
+ _PTRACE_SETSIGINFO = 0x4203;
+ PTRACE_O_TRACESYSGOOD = 0x1;
+ PTRACE_O_TRACEFORK = 0x2;
+ PTRACE_O_TRACEVFORK = 0x4;
+ PTRACE_O_TRACECLONE = 0x8;
+ PTRACE_O_TRACEEXEC = 0x10;
+ PTRACE_O_TRACEVFORKDONE = 0x20;
+ PTRACE_O_TRACEEXIT = 0x40;
+ PTRACE_O_MASK = 0x7f;
+ PTRACE_EVENT_FORK = 0x1;
+ PTRACE_EVENT_VFORK = 0x2;
+ PTRACE_EVENT_CLONE = 0x3;
+ PTRACE_EVENT_EXEC = 0x4;
+ PTRACE_EVENT_VFORK_DONE = 0x5;
+ PTRACE_EVENT_EXIT = 0x6;
EPOLLIN = 0x1;
EPOLLRDHUP = 0x2000;
EPOLLOUT = 0x4;
// Types
+type _C_short int16
+
+type _C_int int32
+
+type _C_long int32
+
+type _C_long_long int64
+
type Timespec struct {
Sec int32;
Nsec int32;
Max uint64;
}
-type _C_int int32
-
type _Gid_t uint32
type Stat_t struct {
Linger int32;
}
+type PtraceRegs struct {
+ Ebx int32;
+ Ecx int32;
+ Edx int32;
+ Esi int32;
+ Edi int32;
+ Ebp int32;
+ Eax int32;
+ Ds uint16;
+ __ds uint16;
+ Es uint16;
+ __es uint16;
+ Fs uint16;
+ __fs uint16;
+ Gs uint16;
+ __gs uint16;
+ Eax int32;
+ Eip int32;
+ Cs uint16;
+ __cs uint16;
+ Eflags int32;
+ Esp int32;
+ Ss uint16;
+ __ss uint16;
+}
+
type FdSet struct {
Bits [32]int32;
}