Message type for PM_GETEPINFO
Change-Id: I275f5c50d433fa400c5eddbc85dd3df8eb5dcb90
This commit is contained in:
parent
a1c31f335c
commit
de7aa3340b
4 changed files with 23 additions and 11 deletions
|
@ -61,11 +61,6 @@
|
||||||
|
|
||||||
#define NR_PM_CALLS 48 /* highest number from base plus one */
|
#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. */
|
/* Field names for the exit(2) call. */
|
||||||
#define PM_EXIT_STATUS m1_i1 /* int */
|
#define PM_EXIT_STATUS m1_i1 /* int */
|
||||||
|
|
||||||
|
|
|
@ -380,6 +380,21 @@ typedef struct {
|
||||||
} mess_lc_vfs_umount;
|
} mess_lc_vfs_umount;
|
||||||
_ASSERT_MSG_SIZE(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 {
|
typedef struct {
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
|
|
||||||
|
@ -897,12 +912,14 @@ typedef struct {
|
||||||
mess_lc_vfs_umask m_lc_vfs_umask;
|
mess_lc_vfs_umask m_lc_vfs_umask;
|
||||||
mess_lc_vfs_umount m_lc_vfs_umount;
|
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_pm_getprocnr m_lsys_pm_getprocnr;
|
||||||
|
|
||||||
mess_lsys_vfs_checkperms m_lsys_vfs_checkperms;
|
mess_lsys_vfs_checkperms m_lsys_vfs_checkperms;
|
||||||
mess_lsys_vfs_copyfd m_lsys_vfs_copyfd;
|
mess_lsys_vfs_copyfd m_lsys_vfs_copyfd;
|
||||||
mess_lsys_vfs_mapdriver m_lsys_vfs_mapdriver;
|
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_pm_lsys_getprocnr m_pm_lsys_getprocnr;
|
||||||
|
|
||||||
mess_vfs_fs_breadwrite m_vfs_fs_breadwrite;
|
mess_vfs_fs_breadwrite m_vfs_fs_breadwrite;
|
||||||
|
|
|
@ -11,15 +11,15 @@ getepinfo(endpoint_t proc_ep, uid_t *uid, gid_t *gid)
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
memset(&m, 0, sizeof(m));
|
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)
|
if ((r = _taskcall(PM_PROC_NR, PM_GETEPINFO, &m)) < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
if (uid != NULL)
|
if (uid != NULL)
|
||||||
*uid = m.PM_GETEPINFO_UID;
|
*uid = m.m_pm_lsys_getepinfo.uid;
|
||||||
if (gid != NULL)
|
if (gid != NULL)
|
||||||
*gid = m.PM_GETEPINFO_GID;
|
*gid = m.m_pm_lsys_getepinfo.gid;
|
||||||
return (pid_t) r;
|
return (pid_t) r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -191,13 +191,13 @@ int do_getepinfo(void)
|
||||||
endpoint_t ep;
|
endpoint_t ep;
|
||||||
int slot;
|
int slot;
|
||||||
|
|
||||||
ep = m_in.PM_GETEPINFO_ENDPT;
|
ep = m_in.m_lsys_pm_getepinfo.endpt;
|
||||||
if (pm_isokendpt(ep, &slot) != OK)
|
if (pm_isokendpt(ep, &slot) != OK)
|
||||||
return(ESRCH);
|
return(ESRCH);
|
||||||
|
|
||||||
rmp = &mproc[slot];
|
rmp = &mproc[slot];
|
||||||
mp->mp_reply.PM_GETEPINFO_UID = rmp->mp_effuid;
|
mp->mp_reply.m_pm_lsys_getepinfo.uid = rmp->mp_effuid;
|
||||||
mp->mp_reply.PM_GETEPINFO_GID = rmp->mp_effgid;
|
mp->mp_reply.m_pm_lsys_getepinfo.gid = rmp->mp_effgid;
|
||||||
return(rmp->mp_pid);
|
return(rmp->mp_pid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue