/* Field names for the exit(2) call. */
#define PM_EXIT_STATUS m1_i1 /* int */
-/* Field names for the waitpid(2) call. */
-#define PM_WAITPID_PID m1_i1 /* pid_t */
-#define PM_WAITPID_OPTIONS m1_i2 /* int */
-#define PM_WAITPID_STATUS m2_i1 /* int */
-
/* Field names for the gettimeofday(2), clock_*(2), adjtime(2), stime(2) calls.
*/
#define PM_TIME_CLK_ID m2_i1 /* clockid_t */
} mess_sigcalls;
_ASSERT_MSG_SIZE(mess_sigcalls);
+typedef struct {
+ pid_t pid;
+ int options;
+
+ uint8_t padding[48];
+} mess_lc_pm_waitpid;
+_ASSERT_MSG_SIZE(mess_lc_pm_waitpid);
+
+typedef struct {
+ int status;
+
+ uint8_t padding[52];
+} mess_pm_lc_waitpid;
+_ASSERT_MSG_SIZE(mess_pm_lc_waitpid);
+
typedef struct {
vir_bytes name;
size_t len;
mess_fs_vfs_readsuper m_fs_vfs_readsuper;
mess_fs_vfs_readwrite m_fs_vfs_readwrite;
+ mess_lc_pm_waitpid m_lc_pm_waitpid;
+
mess_lc_vfs_chown m_lc_vfs_chown;
mess_lc_vfs_close m_lc_vfs_close;
mess_lc_vfs_creat m_lc_vfs_creat;
mess_lsys_vfs_copyfd m_lsys_vfs_copyfd;
mess_lsys_vfs_mapdriver m_lsys_vfs_mapdriver;
+ mess_pm_lc_waitpid m_pm_lc_waitpid;
+
mess_pm_lsys_getepinfo m_pm_lsys_getepinfo;
mess_pm_lsys_getprocnr m_pm_lsys_getprocnr;
message m;
memset(&m, 0, sizeof(m));
- m.PM_WAITPID_PID = -1;
- m.PM_WAITPID_OPTIONS = 0;
+ m.m_lc_pm_waitpid.pid = -1;
+ m.m_lc_pm_waitpid.options = 0;
if (_syscall(PM_PROC_NR, PM_WAITPID, &m) < 0) return(-1);
- if (status != 0) *status = m.PM_WAITPID_STATUS;
+ if (status != 0) *status = m.m_pm_lc_waitpid.status;
return(m.m_type);
}
message m;
memset(&m, 0, sizeof(m));
- m.PM_WAITPID_PID = pid;
- m.PM_WAITPID_OPTIONS = options;
+ m.m_lc_pm_waitpid.pid = pid;
+ m.m_lc_pm_waitpid.options = options;
if (_syscall(PM_PROC_NR, PM_WAITPID, &m) < 0) return(-1);
- if (status != 0) *status = m.PM_WAITPID_STATUS;
+ if (status != 0) *status = m.m_pm_lc_waitpid.status;
return m.m_type;
}
int i, pidarg, options, children;
/* Set internal variables. */
- pidarg = m_in.PM_WAITPID_PID; /* 1st param */
- options = m_in.PM_WAITPID_OPTIONS; /* 3rd param */
+ pidarg = m_in.m_lc_pm_waitpid.pid; /* 1st param */
+ options = m_in.m_lc_pm_waitpid.options; /* 3rd param */
if (pidarg == 0) pidarg = -mp->mp_procgrp; /* pidarg < 0 ==> proc grp */
/* Is there a child waiting to be collected? At this point, pidarg != 0:
if (sigismember(&rp->mp_sigtrace, i)) {
sigdelset(&rp->mp_sigtrace, i);
- mp->mp_reply.PM_WAITPID_STATUS = W_STOPCODE(i);
+ mp->mp_reply.m_pm_lc_waitpid.status = W_STOPCODE(i);
return(rp->mp_pid);
}
}
parent = &mproc[mp_parent];
/* Wake up the parent by sending the reply message. */
- parent->mp_reply.PM_WAITPID_STATUS =
+ parent->mp_reply.m_pm_lc_waitpid.status =
W_EXITCODE(child->mp_exitstatus, child->mp_sigstatus);
reply(child->mp_parent, child->mp_pid);
parent->mp_flags &= ~WAITING; /* parent no longer waiting */
panic("tell_tracer: child not a zombie");
tracer = &mproc[mp_tracer];
- tracer->mp_reply.PM_WAITPID_STATUS =
+ tracer->mp_reply.m_pm_lc_waitpid.status =
W_EXITCODE(child->mp_exitstatus, (child->mp_sigstatus & 0377));
reply(child->mp_tracer, child->mp_pid);
tracer->mp_flags &= ~WAITING; /* tracer no longer waiting */
sigdelset(&rmp->mp_sigtrace, signo);
rpmp->mp_flags &= ~WAITING; /* parent is no longer waiting */
- rpmp->mp_reply.PM_WAITPID_STATUS = W_STOPCODE(signo);
+ rpmp->mp_reply.m_pm_lc_waitpid.status = W_STOPCODE(signo);
reply(rmp->mp_tracer, rmp->mp_pid);
}
}