/*
* Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
* Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
* Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
* Copyright (c) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
* Linux for s390 port by D.J. Barrow
* <barrow_dj@mail.yahoo.com,djbarrow@de.ibm.com>
* Copyright (c) 2000 PocketPenguins Inc. Linux for Hitachi SuperH
* port by Greg Banks <gbanks@pocketpenguins.com>
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: process.c,v 1.104 2007/01/11 22:05:05 ldv Exp $
*/
#include "defs.h"
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/wait.h>
#include <sys/resource.h>
#include <sys/utsname.h>
#include <sys/user.h>
#include <sys/syscall.h>
#include <signal.h>
#ifdef SUNOS4
#include <machine/reg.h>
#endif /* SUNOS4 */
#ifdef FREEBSD
#include <sys/ptrace.h>
#endif
#if HAVE_ASM_REG_H
#if defined (SPARC) || defined (SPARC64)
# define fpq kernel_fpq
# define fq kernel_fq
# define fpu kernel_fpu
#endif /* SPARC || SPARC64 */
#include <asm/reg.h>
#if defined (SPARC) || defined (SPARC64)
# undef fpq
# undef fq
# undef fpu
#endif /* SPARC || SPARC64 */
#endif /* HAVE_ASM_REG_H */
#ifdef HAVE_SYS_REG_H
# include <sys/reg.h>
#ifndef PTRACE_PEEKUSR
# define PTRACE_PEEKUSR PTRACE_PEEKUSER
#endif
#ifndef PTRACE_POKEUSR
# define PTRACE_POKEUSR PTRACE_POKEUSER
#endif
#endif
#ifdef HAVE_LINUX_PTRACE_H
#undef PTRACE_SYSCALL
# ifdef HAVE_STRUCT_IA64_FPREG
# define ia64_fpreg XXX_ia64_fpreg
# endif
# ifdef HAVE_STRUCT_PT_ALL_USER_REGS
# define pt_all_user_regs XXX_pt_all_user_regs
# endif
#include <linux/ptrace.h>
# undef ia64_fpreg
# undef pt_all_user_regs
#endif
#if defined (LINUX) && defined (SPARC64)
# define r_pc r_tpc
# undef PTRACE_GETREGS
# define PTRACE_GETREGS PTRACE_GETREGS64
# undef PTRACE_SETREGS
# define PTRACE_SETREGS PTRACE_SETREGS64
#endif /* LINUX && SPARC64 */
#ifdef HAVE_LINUX_FUTEX_H
#include <linux/futex.h>
#endif
#if defined LINUX
# ifndef FUTEX_WAIT
# define FUTEX_WAIT 0
# endif
# ifndef FUTEX_WAKE
# define FUTEX_WAKE 1
# endif
# ifndef FUTEX_FD
# define FUTEX_FD 2
# endif
# ifndef FUTEX_REQUEUE
# define FUTEX_REQUEUE 3
# endif
#endif
#ifdef LINUX
#include <sched.h>
#include <asm/posix_types.h>
#undef GETGROUPS_T
#define GETGROUPS_T __kernel_gid_t
#undef GETGROUPS32_T
#define GETGROUPS32_T __kernel_gid32_t
#endif /* LINUX */
#if defined(LINUX) && defined(IA64)
# include <asm/ptrace_offsets.h>
# include <asm/rse.h>
#endif
#ifdef HAVE_PRCTL
#include <sys/prctl.h>
#endif
#ifndef WCOREDUMP
#define WCOREDUMP(status) ((status) & 0200)
#endif
/* WTA: this was `&& !defined(LINUXSPARC)', this seems unneeded though? */
#if defined(HAVE_PRCTL)
static const struct xlat prctl_options[] = {
#ifdef PR_MAXPROCS
{ PR_MAXPROCS, "PR_MAXPROCS" },
#endif
#ifdef PR_ISBLOCKED
{ PR_ISBLOCKED, "PR_ISBLOCKED" },
#endif
#ifdef PR_SETSTACKSIZE
{ PR_SETSTACKSIZE, "PR_SETSTACKSIZE" },
#endif
#ifdef PR_GETSTACKSIZE
{ PR_GETSTACKSIZE, "PR_GETSTACKSIZE" },
#endif
#ifdef PR_MAXPPROCS
{ PR_MAXPPROCS, "PR_MAXPPROCS" },
#endif
#ifdef PR_UNBLKONEXEC
{ PR_UNBLKONEXEC, "PR_UNBLKONEXEC" },
#endif
#ifdef PR_ATOMICSIM
{ PR_ATOMICSIM, "PR_ATOMICSIM" },
#endif
#ifdef PR_SETEXITSIG
{ PR_SETEXITSIG, "PR_SETEXITSIG" },
#endif
#ifdef PR_RESIDENT
{ PR_RESIDENT, "PR_RESIDENT" },
#endif
#ifdef PR_ATTACHADDR
{ PR_ATTACHADDR, "PR_ATTACHADDR" },
#endif
#ifdef PR_DETACHADDR
{ PR_DETACHADDR, "PR_DETACHADDR" },
#endif
#ifdef PR_TERMCHILD
{ PR_TERMCHILD, "PR_TERMCHILD" },
#endif
#ifdef PR_GETSHMASK
{ PR_GETSHMASK, "PR_GETSHMASK" },
#endif
#ifdef PR_GETNSHARE
{ PR_GETNSHARE, "PR_GETNSHARE" },
#endif
#if defined(PR_SET_PDEATHSIG)
{ PR_SET_PDEATHSIG, "PR_SET_PDEATHSIG" },
#endif
#ifdef PR_COREPID
{ PR_COREPID, "PR_COREPID" },
#endif
#ifdef PR_ATTACHADDRPERM
{ PR_ATTACHADDRPERM, "PR_ATTACHADDRPERM" },
#endif
#ifdef PR_PTHREADEXIT
{ PR_PTHREADEXIT, "PR_PTHREADEXIT" },
#endif
#ifdef PR_SET_PDEATHSIG
{ PR_SET_PDEATHSIG, "PR_SET_PDEATHSIG" },
#endif
#ifdef PR_GET_PDEATHSIG
{ PR_GET_PDEATHSIG, "PR_GET_PDEATHSIG" },
#endif
#ifdef PR_GET_UNALIGN
{ PR_GET_UNALIGN, "PR_GET_UNALIGN" },
#endif
#ifdef PR_SET_UNALIGN
{ PR_SET_UNALIGN, "PR_SET_UNALIGN" },
#endif
#ifdef PR_GET_KEEPCAPS
{ PR_GET_KEEPCAPS, "PR_GET_KEEP_CAPS" },
#endif
#ifdef PR_SET_KEEPCAPS
{ PR_SET_KEEPCAPS, "PR_SET_KEEP_CAPS" },
#endif
{ 0, NULL },
};
static const char *
unalignctl_string (unsigned int ctl)
{
static char buf[16];
switch (ctl) {
#ifdef PR_UNALIGN_NOPRINT
case PR_UNALIGN_NOPRINT:
return "NOPRINT";
#endif
#ifdef PR_UNALIGN_SIGBUS
case PR_UNALIGN_SIGBUS:
return "SIGBUS";
#endif
default:
break;
}
sprintf(buf, "%x", ctl);
return buf;
}
int
sys_prctl(tcp)
struct tcb *tcp;
{
int i;
if (entering(tcp)) {
printxval(prctl_options, tcp->u_arg[0], "PR_???");
switch (tcp->u_arg[0]) {
#ifdef PR_GETNSHARE
case PR_GETNSHARE:
break;
#endif
#ifdef PR_SET_DEATHSIG
case PR_GET_PDEATHSIG:
break;
#endif
#ifdef PR_SET_UNALIGN
case PR_SET_UNALIGN:
tprintf(", %s", unalignctl_string(tcp->u_arg[1]));
break;
#endif
#ifdef PR_GET_UNALIGN
case PR_GET_UNALIGN:
tprintf(", %#lx", tcp->u_arg[1]);
break;
#endif
default:
for (i = 1; i < tcp->u_nargs; i++)
tprintf(", %#lx", tcp->u_arg[i]);
break;
}
} else {
switch (tcp->u_arg[0]) {
#ifdef PR_GET_PDEATHSIG
case PR_GET_PDEATHSIG:
for (i=1; i<tcp->u_nargs; i++)
tprintf(", %#lx", tcp->u_arg[i]);
break;
#endif
#ifdef PR_SET_UNALIGN
case PR_SET_UNALIGN:
break;
#endif
#ifdef PR_GET_UNALIGN
case PR_GET_UNALIGN:
{
int ctl;
umove(tcp, tcp->u_arg[1], &ctl);
tcp->auxstr = unalignctl_string(ctl);
return RVAL_STR;
}
#endif
default:
break;
}
}
return 0;
}
#endif /* HAVE_PRCTL */
#if defined(FREEBSD) || defined(SUNOS4) || defined(SVR4)
int
sys_gethostid(tcp)
struct tcb *tcp;
{
if (exiting(tcp))
return RVAL_HEX;
return 0;
}
#endif /* FREEBSD || SUNOS4 || SVR4 */
int
sys_sethostname(tcp)
struct tcb *tcp;
{
if (entering(tcp)) {
printpathn(tcp, tcp->u_arg[0], tcp->u_arg[1]);
tprintf(", %lu", tcp->u_arg[1]);
}
return 0;
}
#if defined(ALPHA) || defined(FREEBSD) || defined(SUNOS4) || defined(SVR4)
int
sys_gethostname(tcp)
struct tcb *tcp;
{
if (exiting(tcp)) {
if (syserror(tcp))
tprintf("%#lx", tcp->u_arg[0]);
else
printpath(tcp, tcp->u_arg[0]);
tprintf(", %lu", tcp->u_arg[1]);
}
return 0;
}
#endif /* AL
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
linux C语言调试工具 (163个子文件)
strace.1 19KB
syscall.h.2 6KB
configure.ac 6KB
Makefile.am 4KB
AUTHORS 75B
process.c 79KB
syscall.c 61KB
system.c 58KB
strace.c 57KB
file.c 56KB
util.c 46KB
signal.c 41KB
net.c 39KB
stream.c 29KB
quota.c 19KB
time.c 18KB
desc.c 17KB
mem.c 17KB
resource.c 11KB
ipc.c 11KB
term.c 9KB
io.c 9KB
count.c 7KB
sock.c 6KB
proc.c 6KB
ioctl.c 6KB
bjm.c 6KB
ioctlsort.c 2KB
ioctlsort.c 1KB
syscalls.cat 3KB
ChangeLog 152KB
changelog 20KB
configure 271KB
control 2KB
copyright 2KB
COPYRIGHT 2KB
CREDITS 2KB
depcomp 14KB
xlate.el 3KB
config.guess 42KB
syscallent.h 228KB
ioctlent.h 62KB
ioctlent.h 54KB
ioctlent.h 52KB
ioctlent.h 49KB
syscallent.h 46KB
ioctlent.h 43KB
ioctlent.h 43KB
ioctlent.h 40KB
ioctlent2.h 39KB
ioctlent.h 39KB
ioctlent.h 39KB
ioctlent.h 39KB
ioctlent.h 39KB
ioctlent.h 37KB
syscallent.h 37KB
errnoent.h 27KB
syscallent.h 24KB
syscallent.h 23KB
syscallent.h 23KB
ioctlent.h 22KB
syscallent.h 22KB
syscallent.h 22KB
syscallent.h 22KB
syscallent.h 22KB
syscallent.h 21KB
syscallent.h 20KB
syscallent1.h 20KB
syscallent1.h 20KB
defs.h 19KB
syscallent.h 17KB
ioctlent.h 17KB
syscallent.h 16KB
syscallent.h 16KB
syscallent2.h 16KB
syscall1.h 15KB
syscall1.h 15KB
syscall.h 15KB
syscallent.h 14KB
syscallent.h 13KB
dummy.h 12KB
errnoent.h 12KB
errnoent.h 12KB
errnoent.h 12KB
errnoent.h 12KB
syscall.h 11KB
syscallent.h 11KB
dummy2.h 10KB
dummy2.h 10KB
syscall.h 8KB
dummy.h 7KB
dummy.h 7KB
syscall.h 7KB
syscall.h 7KB
errnoent.h 6KB
errnoent.h 3KB
errnoent.h 3KB
errnoent.h 3KB
errnoent.h 3KB
errnoent2.h 3KB
共 163 条
- 1
- 2
资源评论
kx2018
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 实现了7种排序算法.三种复杂度排序.三种nlogn复杂度排序(堆排序,归并排序,快速排序)一种线性复杂度的排序.zip
- 冒泡排序 直接选择排序 直接插入排序 随机快速排序 归并排序 堆排序.zip
- 课设-内部排序算法比较 包括冒泡排序、直接插入排序、简单选择排序、快速排序、希尔排序、归并排序和堆排序.zip
- Python排序算法.zip
- C语言实现直接插入排序、希尔排序、选择排序、冒泡排序、堆排序、快速排序、归并排序、计数排序,并带图详解.zip
- 常用工具集参考用于图像等数据处理
- 音乐展示网页、基于Stenography的图像数字水印添加与提取,以及基于颜色矩和Tamura算法的图像相似度评估算法py源码
- 基于EmguCV(OpenCV .net封装),图像数字水印加解密算法的实现,其中包含最低有效位算法,离散傅里叶变换算法+文档书
- 基于matlab+DWT的图像水印项目,数字水印+源代码+文档说明+图片+报告pdf
- (优秀毕业设计)基于python实现的数字图像可视化水印系统的设计与实现,多种数字算法实现+源代码+文档说明+理论演示pdf
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功