From: Lionel Sambuc Date: Mon, 12 May 2014 16:55:29 +0000 (+0200) Subject: Message type for PM_GETEPINFO X-Git-Tag: v3.3.0~296 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/rndc.conf.html?a=commitdiff_plain;h=de7aa3340be71f02dde6752df84671d4cf350166;p=minix.git Message type for PM_GETEPINFO Change-Id: I275f5c50d433fa400c5eddbc85dd3df8eb5dcb90 --- diff --git a/include/minix/callnr.h b/include/minix/callnr.h index 997b36816..0d8562ae6 100644 --- a/include/minix/callnr.h +++ b/include/minix/callnr.h @@ -61,11 +61,6 @@ #define NR_PM_CALLS 48 /* highest number from base plus one */ -/* Field names for the getepinfo(2) call. */ -#define PM_GETEPINFO_ENDPT m1_i1 /* endpoint_t */ -#define PM_GETEPINFO_UID m1_i1 /* uid_t */ -#define PM_GETEPINFO_GID m1_i2 /* gid_t */ - /* Field names for the exit(2) call. */ #define PM_EXIT_STATUS m1_i1 /* int */ diff --git a/include/minix/ipc.h b/include/minix/ipc.h index c9dc5f464..4a34baf17 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -380,6 +380,21 @@ typedef struct { } mess_lc_vfs_umount; _ASSERT_MSG_SIZE(mess_lc_vfs_umount); +typedef struct { + endpoint_t endpt; + + uint8_t padding[52]; +} mess_lsys_pm_getepinfo; +_ASSERT_MSG_SIZE(mess_lsys_pm_getepinfo); + +typedef struct { + uid_t uid; + gid_t gid; + + uint8_t padding[48]; +} mess_pm_lsys_getepinfo; +_ASSERT_MSG_SIZE(mess_pm_lsys_getepinfo); + typedef struct { pid_t pid; @@ -897,12 +912,14 @@ typedef struct { mess_lc_vfs_umask m_lc_vfs_umask; mess_lc_vfs_umount m_lc_vfs_umount; + mess_lsys_pm_getepinfo m_lsys_pm_getepinfo; mess_lsys_pm_getprocnr m_lsys_pm_getprocnr; mess_lsys_vfs_checkperms m_lsys_vfs_checkperms; mess_lsys_vfs_copyfd m_lsys_vfs_copyfd; mess_lsys_vfs_mapdriver m_lsys_vfs_mapdriver; + mess_pm_lsys_getepinfo m_pm_lsys_getepinfo; mess_pm_lsys_getprocnr m_pm_lsys_getprocnr; mess_vfs_fs_breadwrite m_vfs_fs_breadwrite; diff --git a/lib/libsys/getepinfo.c b/lib/libsys/getepinfo.c index 9e594c92c..26427f14c 100644 --- a/lib/libsys/getepinfo.c +++ b/lib/libsys/getepinfo.c @@ -11,15 +11,15 @@ getepinfo(endpoint_t proc_ep, uid_t *uid, gid_t *gid) int r; memset(&m, 0, sizeof(m)); - m.PM_GETEPINFO_ENDPT = proc_ep; + m.m_lsys_pm_getepinfo.endpt = proc_ep; if ((r = _taskcall(PM_PROC_NR, PM_GETEPINFO, &m)) < 0) return r; if (uid != NULL) - *uid = m.PM_GETEPINFO_UID; + *uid = m.m_pm_lsys_getepinfo.uid; if (gid != NULL) - *gid = m.PM_GETEPINFO_GID; + *gid = m.m_pm_lsys_getepinfo.gid; return (pid_t) r; } diff --git a/servers/pm/misc.c b/servers/pm/misc.c index 12d80ee0a..c4c3781ab 100644 --- a/servers/pm/misc.c +++ b/servers/pm/misc.c @@ -191,13 +191,13 @@ int do_getepinfo(void) endpoint_t ep; int slot; - ep = m_in.PM_GETEPINFO_ENDPT; + ep = m_in.m_lsys_pm_getepinfo.endpt; if (pm_isokendpt(ep, &slot) != OK) return(ESRCH); rmp = &mproc[slot]; - mp->mp_reply.PM_GETEPINFO_UID = rmp->mp_effuid; - mp->mp_reply.PM_GETEPINFO_GID = rmp->mp_effgid; + mp->mp_reply.m_pm_lsys_getepinfo.uid = rmp->mp_effuid; + mp->mp_reply.m_pm_lsys_getepinfo.gid = rmp->mp_effgid; return(rmp->mp_pid); }