secondary cache feature in vm.
[minix.git] / lib / libc / posix / _ptrace.c
blobc33059eef88bdd6dbe667d09ef760300b6e5a69b
1 #include <lib.h>
2 #define ptrace _ptrace
3 #include <unistd.h>
5 PUBLIC long ptrace(int req, pid_t pid, long addr, long data)
7 message m;
9 m.m2_i1 = pid;
10 m.m2_i2 = req;
11 m.PMTRACE_ADDR = addr;
12 m.m2_l2 = data;
13 if (_syscall(MM, PTRACE, &m) < 0) return(-1);
15 /* There was no error, but -1 is a legal return value. Clear errno if
16 * necessary to distinguish this case. _syscall has set errno to nonzero
17 * for the error case.
19 if (m.m2_l2 == -1) errno = 0;
20 return(m.m2_l2);