1 /* Copyright (C) 1991-2015 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, see
16 <http://www.gnu.org/licenses/>. */
19 #include <sys/ptrace.h>
20 #include <sys/types.h>
22 #include <libc-internal.h>
24 /* Perform process tracing functions. REQUEST is one of the values
25 in <sys/ptrace.h>, and determines the action to be taken.
26 For all requests except PTRACE_TRACEME, PID specifies the process to be
29 PID and the other arguments described above for the various requests should
30 appear (those that are used for the particular request) as:
31 pid_t PID, void *ADDR, int DATA, void *ADDR2
34 ptrace (enum __ptrace_request request, ...)
47 case PTRACE_SINGLESTEP:
57 #ifdef PTRACE_GETFPREGS
58 case PTRACE_GETFPGEGS:
60 case PTRACE_SETFPREGS:
61 case PTRACE_GETFPAREGS:
62 case PTRACE_SETFPAREGS:
63 va_start (ap, request);
64 pid = va_arg (ap, pid_t);
65 addr = va_arg (ap, void *);
74 va_start (ap, request);
75 pid = va_arg (ap, pid_t);
76 addr = va_arg (ap, void *);
77 data = va_arg (ap, int);
85 case PTRACE_WRITEDATA:
87 case PTRACE_WRITETEXT:
88 va_start (ap, request);
89 pid = va_arg (ap, pid_t);
90 addr = va_arg (ap, void *);
91 data = va_arg (ap, int);
92 addr2 = va_arg (ap, void *);
101 __set_errno (EINVAL);
105 __set_errno (ENOSYS);
109 stub_warning (ptrace)