#endif
extern int internal_fork P((struct tcb *));
extern int internal_exec P((struct tcb *));
-extern int internal_wait P((struct tcb *));
+extern int internal_wait P((struct tcb *, int));
extern int internal_exit P((struct tcb *));
extern struct ioctlent *ioctl_lookup P((long));
}
int
-internal_wait(tcp)
+internal_wait(tcp, flagarg)
struct tcb *tcp;
+int flagarg;
{
int got_kids;
/* ??? WTA: fix bug with hanging children */
- if (!(tcp->u_arg[2] & WNOHANG)) {
+ if (!(tcp->u_arg[flagarg] & WNOHANG)) {
/*
* There are traced children. We'll make the parent
* block to avoid a false ECHILD error due to our
}
}
if (exiting(tcp) && tcp->u_error == ECHILD && got_kids) {
- if (tcp->u_arg[2] & WNOHANG) {
+ if (tcp->u_arg[flagarg] & WNOHANG) {
/* We must force a fake result of 0 instead of
the ECHILD error. */
extern int force_result();
}
#endif
-#ifdef SVR4
+#if defined SVR4 || defined LINUX
static struct xlat waitid_types[] = {
{ P_PID, "P_PID" },
+#ifdef P_PPID
{ P_PPID, "P_PPID" },
+#endif
{ P_PGID, "P_PGID" },
+#ifdef P_SID
{ P_SID, "P_SID" },
+#endif
+#ifdef P_CID
{ P_CID, "P_CID" },
+#endif
+#ifdef P_UID
{ P_UID, "P_UID" },
+#endif
+#ifdef P_GID
{ P_GID, "P_GID" },
+#endif
{ P_ALL, "P_ALL" },
#ifdef P_LWPID
{ P_LWPID, "P_LWPID" },
if (entering(tcp)) {
printxval(waitid_types, tcp->u_arg[0], "P_???");
tprintf(", %ld, ", tcp->u_arg[1]);
- if (tcp->nchildren > 0) {
- /* There are traced children */
- tcp->flags |= TCB_SUSPENDED;
- tcp->waitpid = tcp->u_arg[0];
- }
}
else {
/* siginfo */
return 0;
}
-#endif /* SVR4 */
+#endif /* SVR4 or LINUX */
int
sys_alarm(tcp)