source: trunk/minix/lib/posix/_ptrace.c@ 15

Last change on this file since 15 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 512 bytes
Line 
1#include <lib.h>
2#define ptrace _ptrace
3#include <unistd.h>
4
5PUBLIC long ptrace(req, pid, addr, data)
6int req;
7pid_t pid;
8long addr;
9long data;
10{
11 message m;
12
13 m.m2_i1 = pid;
14 m.m2_i2 = req;
15 m.m2_l1 = addr;
16 m.m2_l2 = data;
17 if (_syscall(MM, PTRACE, &m) < 0) return(-1);
18
19 /* There was no error, but -1 is a legal return value. Clear errno if
20 * necessary to distinguish this case. _syscall has set errno to nonzero
21 * for the error case.
22 */
23 if (m.m2_l2 == -1) errno = 0;
24 return(m.m2_l2);
25}
Note: See TracBrowser for help on using the repository browser.