/* Field names for the setsid(2) call. */
#define PM_GETSID_PID m1_i1 /* pid_t */
-/* Field names for the setgroups(2)/setgroups(2) calls. */
-#define PM_GROUPS_NUM m1_i1 /* int */
-#define PM_GROUPS_PTR m1_p1 /* gid_t * */
-
/* Field names for the getmcontext(2)/setmcontext(2) calls. */
#define PM_MCONTEXT_CTX m1_p1 /* mcontext_t * */
} mess_sigcalls;
_ASSERT_MSG_SIZE(mess_sigcalls);
+typedef struct {
+ int num;
+ vir_bytes ptr; /* gid_t * */
+
+ uint8_t padding[48];
+} mess_lc_pm_groups;
+_ASSERT_MSG_SIZE(mess_lc_pm_groups);
+
typedef struct {
int which;
vir_bytes value; /* const struct itimerval * */
mess_fs_vfs_readsuper m_fs_vfs_readsuper;
mess_fs_vfs_readwrite m_fs_vfs_readwrite;
+ mess_lc_pm_groups m_lc_pm_groups;
mess_lc_pm_itimer m_lc_pm_itimer;
mess_lc_pm_priority m_lc_pm_priority;
mess_lc_pm_ptrace m_lc_pm_ptrace;
message m;
memset(&m, 0, sizeof(m));
- m.PM_GROUPS_NUM = ngroups;
- m.PM_GROUPS_PTR = (char *) arr;
+ m.m_lc_pm_groups.num = ngroups;
+ m.m_lc_pm_groups.ptr = (vir_bytes)arr;
return(_syscall(PM_PROC_NR, PM_GETGROUPS, &m));
}
message m;
memset(&m, 0, sizeof(m));
- m.PM_GROUPS_PTR = (char *) __UNCONST(gidset);
- m.PM_GROUPS_NUM = ngroups;
+ m.m_lc_pm_groups.ptr = (vir_bytes)gidset;
+ m.m_lc_pm_groups.num = ngroups;
return(_syscall(PM_PROC_NR, PM_SETGROUPS, &m));
}
switch(call_nr) {
case PM_GETGROUPS:
- ngroups = m_in.PM_GROUPS_NUM;
+ ngroups = m_in.m_lc_pm_groups.num;
if (ngroups > NGROUPS_MAX || ngroups < 0)
return(EINVAL);
return(EINVAL);
r = sys_datacopy(SELF, (vir_bytes) rmp->mp_sgroups, who_e,
- (vir_bytes) m_in.PM_GROUPS_PTR,
- ngroups * sizeof(gid_t));
+ m_in.m_lc_pm_groups.ptr, ngroups * sizeof(gid_t));
if (r != OK)
return(r);
if (rmp->mp_effuid != SUPER_USER)
return(EPERM);
- ngroups = m_in.PM_GROUPS_NUM;
+ ngroups = m_in.m_lc_pm_groups.num;
if (ngroups > NGROUPS_MAX || ngroups < 0)
return(EINVAL);
- if (ngroups > 0 && m_in.PM_GROUPS_PTR == NULL)
+ if (ngroups > 0 && m_in.m_lc_pm_groups.ptr == 0)
return(EFAULT);
- r = sys_datacopy(who_e, (vir_bytes) m_in.PM_GROUPS_PTR, SELF,
+ r = sys_datacopy(who_e, m_in.m_lc_pm_groups.ptr, SELF,
(vir_bytes) rmp->mp_sgroups,
ngroups * sizeof(gid_t));
if (r != OK)