typedef int syscall_func_t PARAMS ((struct procinfo *pi, int syscall_num, int why, int *rtnval, int *statval));
for (pi = procinfo_list; pi; pi = pi->next) if (pi->pid == pid) break;
static struct procinfo *find_procinfo PARAMS ((pid_t pid, int okfail));typedef int syscall_func_t PARAMS ((struct procinfo *pi, int syscall_num,				    int why, int *rtnval, int *statval));static void procfs_set_syscall_trap PARAMS ((struct procinfo *pi,					     int syscall_num, int flags,					     syscall_func_t *func));static void procfs_clear_syscall_trap PARAMS ((struct procinfo *pi,					       int syscall_num, int errok));#define PROCFS_SYSCALL_ENTRY 0x1 /* Trap on entry to sys call */#define PROCFS_SYSCALL_EXIT 0x2	/* Trap on exit from sys call */static syscall_func_t procfs_exit_handler;static syscall_func_t procfs_exec_handler;#ifdef SYS_sprocstatic syscall_func_t procfs_sproc_handler;static syscall_func_t procfs_fork_handler;#endif#ifdef SYS_lwp_createstatic syscall_func_t procfs_lwp_creation_handler;#endifstatic void modify_inherit_on_fork_flag PARAMS ((int fd, int flag));static void modify_run_on_last_close_flag PARAMS ((int fd, int flag));/* */struct procfs_syscall_handler{  int syscall_num;		/* The number of the system call being handled */				/* The function to be called */  syscall_func_t *func;};static void procfs_resume PARAMS ((int pid, int step,				   enum target_signal signo));/* External function prototypes that can't be easily included in any   header file because the args are typedefs in system include files. */extern void supply_gregset PARAMS ((gregset_t *));extern void fill_gregset PARAMS ((gregset_t *, int));extern void supply_fpregset PARAMS ((fpregset_t *));extern void fill_fpregset PARAMS ((fpregset_t *, int));/*LOCAL FUNCTION	find_procinfo -- convert a process id to a struct procinfoSYNOPSIS	static struct procinfo * find_procinfo (pid_t pid, int okfail);DESCRIPTION		Given a process id, look it up in the procinfo chain.  Returns	a struct procinfo *.  If can't find pid, then call error(),	unless okfail is set, in which case, return NULL; */static struct procinfo *find_procinfo (pid, okfail)     pid_t pid;     int okfail;{  struct procinfo *procinfo;  for (procinfo = procinfo_list; procinfo; procinfo = procinfo->next)    if (procinfo->pid == pid)      return procinfo;  if (okfail)    return NULL;  error ("procfs (find_procinfo):  Couldn't locate pid %d", pid);}