int flags; /* See below for TCB_ values */
int pid; /* Process Id of this entry */
long scno; /* System call number */
- int u_nargs; /* System call arguments */
+ int u_nargs; /* System call argument count */
long u_arg[MAX_ARGS]; /* System call arguments */
#if defined (LINUX_MIPSN32)
long long ext_arg[MAX_ARGS]; /* System call arguments */
/* Support for tracing forked processes */
long baddr; /* `Breakpoint' address */
long inst[2]; /* Instructions on above */
+ int ptrace_errno;
+#ifdef USE_PROCFS
int pfd; /* proc file descriptor */
+#endif
#ifdef SVR4
-#ifdef HAVE_MP_PROCFS
+# ifdef HAVE_MP_PROCFS
int pfd_stat;
int pfd_as;
pstatus_t status;
-#else
+# else
prstatus_t status; /* procfs status structure */
+# endif
#endif
-#endif
- int ptrace_errno;
#ifdef FREEBSD
struct procfs_status status;
int pfd_reg;
tcp->pid = pid;
tcp->flags = TCB_INUSE | TCB_STARTUP;
tcp->outf = outf; /* Initialise to current out file */
+#ifdef USE_PROCFS
tcp->pfd = -1;
+#endif
nprocs++;
if (debug)
fprintf(stderr, "new tcb for pid %d, active tcbs:%d\n", tcp->pid, nprocs);
if (debug)
fprintf(stderr, "dropped tcb for pid %d, %d remain\n", tcp->pid, nprocs);
+#ifdef USE_PROCFS
if (tcp->pfd != -1) {
close(tcp->pfd);
tcp->pfd = -1;
-#ifdef FREEBSD
+# ifdef FREEBSD
if (tcp->pfd_reg != -1) {
close(tcp->pfd_reg);
tcp->pfd_reg = -1;
close(tcp->pfd_status);
tcp->pfd_status = -1;
}
-#endif /* !FREEBSD */
-#ifdef USE_PROCFS
+# endif
tcp->flags = 0; /* rebuild_pollv needs it */
rebuild_pollv();
-#endif
}
+#endif
if (outfname && followfork > 1 && tcp->outf)
fclose(tcp->outf);