#define PM_SYSUNAME_LEN m1_i3 /* char * */
#define PM_SYSUNAME_VALUE m1_p1 /* size_t */
-/* Field names for the getitimer(2)/setitimer(2) calls. */
-#define PM_ITIMER_WHICH m1_i1 /* int */
-#define PM_ITIMER_VALUE m1_p1 /* const struct itimerval * */
-#define PM_ITIMER_OVALUE m1_p2 /* struct itimerval * */
-
/* Field names for the execve(2) call. */
#define PM_EXEC_NAME m1_p1 /* const char * */
#define PM_EXEC_NAMELEN m1_i1 /* size_t */
} mess_sigcalls;
_ASSERT_MSG_SIZE(mess_sigcalls);
+typedef struct {
+ int which;
+ vir_bytes value; /* const struct itimerval * */
+ vir_bytes ovalue; /* struct itimerval * */
+
+ uint8_t padding[44];
+} mess_lc_pm_itimer;
+_ASSERT_MSG_SIZE(mess_lc_pm_itimer);
+
typedef struct {
time_t sec;
mess_fs_vfs_readsuper m_fs_vfs_readsuper;
mess_fs_vfs_readwrite m_fs_vfs_readwrite;
+ mess_lc_pm_itimer m_lc_pm_itimer;
mess_lc_pm_time m_lc_pm_time;
mess_lc_pm_waitpid m_lc_pm_waitpid;
message m;
memset(&m, 0, sizeof(m));
- m.PM_ITIMER_WHICH = which;
- m.PM_ITIMER_VALUE = NULL; /* only retrieve the timer */
- m.PM_ITIMER_OVALUE = (char *) value;
+ m.m_lc_pm_itimer.which = which;
+ m.m_lc_pm_itimer.value = 0; /* only retrieve the timer */
+ m.m_lc_pm_itimer.ovalue = (vir_bytes)value;
return _syscall(PM_PROC_NR, PM_ITIMER, &m);
}
}
memset(&m, 0, sizeof(m));
- m.PM_ITIMER_WHICH = which;
- m.PM_ITIMER_VALUE = (char *) __UNCONST(value);
- m.PM_ITIMER_OVALUE = (char *) ovalue;
+ m.m_lc_pm_itimer.which = which;
+ m.m_lc_pm_itimer.value = (vir_bytes)value;
+ m.m_lc_pm_itimer.ovalue = (vir_bytes)ovalue;
return _syscall(PM_PROC_NR, PM_ITIMER, &m);
}
int r, which;
/* Make sure 'which' is one of the defined timers. */
- which = m_in.PM_ITIMER_WHICH;
+ which = m_in.m_lc_pm_itimer.which;
if (which < 0 || which >= NR_ITIMERS) return(EINVAL);
/* Determine whether to set and/or return the given timer value, based on
* which of the value and ovalue parameters are nonzero. At least one of
* them must be nonzero.
*/
- setval = (m_in.PM_ITIMER_VALUE != NULL);
- getval = (m_in.PM_ITIMER_OVALUE != NULL);
+ setval = (m_in.m_lc_pm_itimer.value != 0);
+ getval = (m_in.m_lc_pm_itimer.ovalue != 0);
if (!setval && !getval) return(EINVAL);
* Also, make sure its fields have sane values.
*/
if (setval) {
- r = sys_datacopy(who_e, (vir_bytes) m_in.PM_ITIMER_VALUE,
- PM_PROC_NR, (vir_bytes) &value, (phys_bytes) sizeof(value));
+ r = sys_datacopy(who_e, m_in.m_lc_pm_itimer.value,
+ PM_PROC_NR, (vir_bytes)&value, (phys_bytes)sizeof(value));
if (r != OK) return(r);
if (!is_sane_timeval(&value.it_value) ||
/* If requested, copy the old interval timer to user space. */
if (r == OK && getval) {
- r = sys_datacopy(PM_PROC_NR, (vir_bytes) &ovalue,
- who_e, (vir_bytes) m_in.PM_ITIMER_OVALUE,
- (phys_bytes) sizeof(ovalue));
+ r = sys_datacopy(PM_PROC_NR, (vir_bytes)&ovalue,
+ who_e, m_in.m_lc_pm_itimer.ovalue,
+ (phys_bytes)sizeof(ovalue));
}
return(r);