glibc/sysdeps/stub/ptrace.c

103 lines
2.7 KiB
C
Raw Normal View History

* sysdeps/unix/i386/sysdep.h [HAVE_ELF] (ASM_TYPE_DIRECTIVE): Don't use `type' for arg name, since we are using it as a keyword in the rhs. * sysdeps/unix/configure.in: Check for syscalls getpriority, setpriority, getrlimit, setrlimit. * sysdeps/posix/truncate.c: Include fcntl.h. * sysdeps/generic/getdomain.c: Include string.h for strncpy decl. * sysdeps/stub/getpriority.c: Don't include obsolete gnu-stabs.h; use new stub_warning syntax. * sysdeps/stub/setpriority.c: Likewise. * sysdeps/stub/__longjmp.c: Likewise. * sysdeps/stub/_exit.c: Likewise. * sysdeps/stub/accept.c: Likewise. * sysdeps/stub/acos.c: Likewise. * sysdeps/stub/alarm.c: Likewise. * sysdeps/stub/asin.c: Likewise. * sysdeps/stub/atan2.c: Likewise. * sysdeps/stub/bind.c: Likewise. * sysdeps/stub/cbrt.c: Likewise. * sysdeps/stub/chroot.c: Likewise. * sysdeps/stub/closedir.c: Likewise. * sysdeps/stub/connect.c: Likewise. * sysdeps/stub/cos.c: Likewise. * sysdeps/stub/cosh.c: Likewise. * sysdeps/stub/ctermid.c: Likewise. * sysdeps/stub/cuserid.c: Likewise. * sysdeps/stub/defs.c: Likewise. * sysdeps/stub/exp.c: Likewise. * sysdeps/stub/fmod.c: Likewise. * sysdeps/stub/frexp.c: Likewise. * sysdeps/stub/fsync.c: Likewise. * sysdeps/stub/getcwd.c: Likewise. * sysdeps/stub/getenv.c: Likewise. * sysdeps/stub/gethostid.c: Likewise. * sysdeps/stub/getlogin.c: Likewise. * sysdeps/stub/getpeername.c: Likewise. * sysdeps/stub/getrlimit.c: Likewise. * sysdeps/stub/getsockname.c: Likewise. * sysdeps/stub/getsockopt.c: Likewise. * sysdeps/stub/listen.c: Likewise. * sysdeps/stub/log.c: Likewise. * sysdeps/stub/log10.c: Likewise. * sysdeps/stub/mkfifo.c: Likewise. * sysdeps/stub/morecore.c: Likewise. * sysdeps/stub/nice.c: Likewise. * sysdeps/stub/nlist.c: Likewise. * sysdeps/stub/opendir.c: Likewise. * sysdeps/stub/pipestream.c: Likewise. * sysdeps/stub/ptrace.c: Likewise. * sysdeps/stub/putenv.c: Likewise. * sysdeps/stub/readdir.c: Likewise. * sysdeps/stub/reboot.c: Likewise. * sysdeps/stub/recv.c: Likewise. * sysdeps/stub/recvfrom.c: Likewise. * sysdeps/stub/rename.c: Likewise. * sysdeps/stub/rewinddir.c: Likewise. * sysdeps/stub/seekdir.c: Likewise. * sysdeps/stub/send.c: Likewise. * sysdeps/stub/sendto.c: Likewise. * sysdeps/stub/setegid.c: Likewise. * sysdeps/stub/seteuid.c: Likewise. * sysdeps/stub/setgroups.c: Likewise. * sysdeps/stub/sethostid.c: Likewise. * sysdeps/stub/sethostname.c: Likewise. * sysdeps/stub/setjmp.c: Likewise. * sysdeps/stub/setrlimit.c: Likewise. * sysdeps/stub/setsockopt.c: Likewise. * sysdeps/stub/shutdown.c: Likewise. * sysdeps/stub/signal.c: Likewise. * sysdeps/stub/sigsuspend.c: Likewise. * sysdeps/stub/sin.c: Likewise. * sysdeps/stub/sinh.c: Likewise. * sysdeps/stub/socket.c: Likewise. * sysdeps/stub/socketpair.c: Likewise. * sysdeps/stub/sqrt.c: Likewise. * sysdeps/stub/sync.c: Likewise. M sysd-stdio.c * sysdeps/stub/system.c: Likewise. * sysdeps/stub/tan.c: Likewise. * sysdeps/stub/tanh.c: Likewise. * sysdeps/stub/tcdrain.c: Likewise. * sysdeps/stub/tcflow.c: Likewise. * sysdeps/stub/tcgetpgrp.c: Likewise. * sysdeps/stub/tcsendbrk.c: Likewise. * sysdeps/stub/tcsetattr.c: Likewise. * sysdeps/stub/tcsetpgrp.c: Likewise. * sysdeps/stub/telldir.c: Likewise. * sysdeps/stub/tempname.c: Likewise. * sysdeps/stub/ttyname.c: Likewise. * sysdeps/stub/ttyname_r.c: Likewise. * sysdeps/stub/utime.c: Likewise. * gmon/gmon.c (moncontrol): Don't cast buffer arg to profil. * time/mktime.c (localtime_r): Use 0 instead of NULL.
1995-09-27 17:05:25 +01:00
/* Copyright (C) 1991, 1992, 1993, 1995 Free Software Foundation, Inc.
1995-02-18 02:27:10 +01:00
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
#include <ansidecl.h>
#include <errno.h>
#include <sys/ptrace.h>
#include <sys/types.h>
#include <stdarg.h>
/* Perform process tracing functions. REQUEST is one of the values
in <sys/ptrace.h>, and determines the action to be taken.
For all requests except PTRACE_TRACEME, PID specifies the process to be
traced.
PID and the other arguments described above for the various requests should
appear (those that are used for the particular request) as:
pid_t PID, void *ADDR, int DATA, void *ADDR2
after PID. */
int
DEFUN(ptrace, (request), enum __ptrace_request request DOTS)
{
pid_t pid;
PTR addr;
PTR addr2;
int data;
va_list ap;
switch (request)
{
case PTRACE_TRACEME:
case PTRACE_CONT:
case PTRACE_KILL:
case PTRACE_SINGLESTEP:
case PTRACE_ATTACH:
case PTRACE_DETACH:
break;
case PTRACE_PEEKTEXT:
case PTRACE_PEEKDATA:
case PTRACE_PEEKUSER:
case PTRACE_GETREGS:
case PTRACE_SETREGS:
#ifdef PTRACE_GETFPREGS
case PTRACE_GETFPGEGS:
#endif
case PTRACE_SETFPREGS:
case PTRACE_GETFPAREGS:
case PTRACE_SETFPAREGS:
va_start(ap, request);
pid = va_arg(ap, pid_t);
addr = va_arg(ap, PTR);
va_end(ap);
break;
case PTRACE_POKETEXT:
case PTRACE_POKEDATA:
case PTRACE_POKEUSER:
va_start(ap, request);
pid = va_arg(ap, pid_t);
addr = va_arg(ap, PTR);
data = va_arg(ap, int);
va_end(ap);
break;
case PTRACE_READDATA:
case PTRACE_WRITEDATA:
case PTRACE_READTEXT:
case PTRACE_WRITETEXT:
va_start(ap, request);
pid = va_arg(ap, pid_t);
addr = va_arg(ap, PTR);
data = va_arg(ap, int);
addr2 = va_arg(ap, PTR);
va_end(ap);
break;
default:
errno = EINVAL;
return -1;
}
errno = ENOSYS;
return -1;
}
* sysdeps/unix/i386/sysdep.h [HAVE_ELF] (ASM_TYPE_DIRECTIVE): Don't use `type' for arg name, since we are using it as a keyword in the rhs. * sysdeps/unix/configure.in: Check for syscalls getpriority, setpriority, getrlimit, setrlimit. * sysdeps/posix/truncate.c: Include fcntl.h. * sysdeps/generic/getdomain.c: Include string.h for strncpy decl. * sysdeps/stub/getpriority.c: Don't include obsolete gnu-stabs.h; use new stub_warning syntax. * sysdeps/stub/setpriority.c: Likewise. * sysdeps/stub/__longjmp.c: Likewise. * sysdeps/stub/_exit.c: Likewise. * sysdeps/stub/accept.c: Likewise. * sysdeps/stub/acos.c: Likewise. * sysdeps/stub/alarm.c: Likewise. * sysdeps/stub/asin.c: Likewise. * sysdeps/stub/atan2.c: Likewise. * sysdeps/stub/bind.c: Likewise. * sysdeps/stub/cbrt.c: Likewise. * sysdeps/stub/chroot.c: Likewise. * sysdeps/stub/closedir.c: Likewise. * sysdeps/stub/connect.c: Likewise. * sysdeps/stub/cos.c: Likewise. * sysdeps/stub/cosh.c: Likewise. * sysdeps/stub/ctermid.c: Likewise. * sysdeps/stub/cuserid.c: Likewise. * sysdeps/stub/defs.c: Likewise. * sysdeps/stub/exp.c: Likewise. * sysdeps/stub/fmod.c: Likewise. * sysdeps/stub/frexp.c: Likewise. * sysdeps/stub/fsync.c: Likewise. * sysdeps/stub/getcwd.c: Likewise. * sysdeps/stub/getenv.c: Likewise. * sysdeps/stub/gethostid.c: Likewise. * sysdeps/stub/getlogin.c: Likewise. * sysdeps/stub/getpeername.c: Likewise. * sysdeps/stub/getrlimit.c: Likewise. * sysdeps/stub/getsockname.c: Likewise. * sysdeps/stub/getsockopt.c: Likewise. * sysdeps/stub/listen.c: Likewise. * sysdeps/stub/log.c: Likewise. * sysdeps/stub/log10.c: Likewise. * sysdeps/stub/mkfifo.c: Likewise. * sysdeps/stub/morecore.c: Likewise. * sysdeps/stub/nice.c: Likewise. * sysdeps/stub/nlist.c: Likewise. * sysdeps/stub/opendir.c: Likewise. * sysdeps/stub/pipestream.c: Likewise. * sysdeps/stub/ptrace.c: Likewise. * sysdeps/stub/putenv.c: Likewise. * sysdeps/stub/readdir.c: Likewise. * sysdeps/stub/reboot.c: Likewise. * sysdeps/stub/recv.c: Likewise. * sysdeps/stub/recvfrom.c: Likewise. * sysdeps/stub/rename.c: Likewise. * sysdeps/stub/rewinddir.c: Likewise. * sysdeps/stub/seekdir.c: Likewise. * sysdeps/stub/send.c: Likewise. * sysdeps/stub/sendto.c: Likewise. * sysdeps/stub/setegid.c: Likewise. * sysdeps/stub/seteuid.c: Likewise. * sysdeps/stub/setgroups.c: Likewise. * sysdeps/stub/sethostid.c: Likewise. * sysdeps/stub/sethostname.c: Likewise. * sysdeps/stub/setjmp.c: Likewise. * sysdeps/stub/setrlimit.c: Likewise. * sysdeps/stub/setsockopt.c: Likewise. * sysdeps/stub/shutdown.c: Likewise. * sysdeps/stub/signal.c: Likewise. * sysdeps/stub/sigsuspend.c: Likewise. * sysdeps/stub/sin.c: Likewise. * sysdeps/stub/sinh.c: Likewise. * sysdeps/stub/socket.c: Likewise. * sysdeps/stub/socketpair.c: Likewise. * sysdeps/stub/sqrt.c: Likewise. * sysdeps/stub/sync.c: Likewise. M sysd-stdio.c * sysdeps/stub/system.c: Likewise. * sysdeps/stub/tan.c: Likewise. * sysdeps/stub/tanh.c: Likewise. * sysdeps/stub/tcdrain.c: Likewise. * sysdeps/stub/tcflow.c: Likewise. * sysdeps/stub/tcgetpgrp.c: Likewise. * sysdeps/stub/tcsendbrk.c: Likewise. * sysdeps/stub/tcsetattr.c: Likewise. * sysdeps/stub/tcsetpgrp.c: Likewise. * sysdeps/stub/telldir.c: Likewise. * sysdeps/stub/tempname.c: Likewise. * sysdeps/stub/ttyname.c: Likewise. * sysdeps/stub/ttyname_r.c: Likewise. * sysdeps/stub/utime.c: Likewise. * gmon/gmon.c (moncontrol): Don't cast buffer arg to profil. * time/mktime.c (localtime_r): Use 0 instead of NULL.
1995-09-27 17:05:25 +01:00
stub_warning (ptrace)