Message type for PM_GETSID

Change-Id: Ife3f9f6a7b6190baca6f379f7d3c36388baf6904
This commit is contained in:
Lionel Sambuc 2014-05-13 15:13:12 +02:00
parent f63d2f0eaf
commit ca31c1caae
4 changed files with 10 additions and 5 deletions

View file

@ -85,9 +85,6 @@
#define PM_SIG_SET m2_sigset /* sigset_t */ #define PM_SIG_SET m2_sigset /* sigset_t */
#define PM_SIG_CTX m2_p1 /* struct sigcontext * */ #define PM_SIG_CTX m2_p1 /* struct sigcontext * */
/* Field names for the setsid(2) call. */
#define PM_GETSID_PID m1_i1 /* pid_t */
/* Field names for the getmcontext(2)/setmcontext(2) calls. */ /* Field names for the getmcontext(2)/setmcontext(2) calls. */
#define PM_MCONTEXT_CTX m1_p1 /* mcontext_t * */ #define PM_MCONTEXT_CTX m1_p1 /* mcontext_t * */

View file

@ -145,6 +145,13 @@ typedef struct {
} mess_sigcalls; } mess_sigcalls;
_ASSERT_MSG_SIZE(mess_sigcalls); _ASSERT_MSG_SIZE(mess_sigcalls);
typedef struct {
pid_t pid;
uint8_t padding[52];
} mess_lc_pm_getsid;
_ASSERT_MSG_SIZE(mess_lc_pm_getsid);
typedef struct { typedef struct {
int num; int num;
vir_bytes ptr; /* gid_t * */ vir_bytes ptr; /* gid_t * */
@ -1050,6 +1057,7 @@ typedef struct {
mess_fs_vfs_readsuper m_fs_vfs_readsuper; mess_fs_vfs_readsuper m_fs_vfs_readsuper;
mess_fs_vfs_readwrite m_fs_vfs_readwrite; mess_fs_vfs_readwrite m_fs_vfs_readwrite;
mess_lc_pm_getsid m_lc_pm_getsid;
mess_lc_pm_groups m_lc_pm_groups; mess_lc_pm_groups m_lc_pm_groups;
mess_lc_pm_itimer m_lc_pm_itimer; mess_lc_pm_itimer m_lc_pm_itimer;
mess_lc_pm_priority m_lc_pm_priority; mess_lc_pm_priority m_lc_pm_priority;

View file

@ -10,6 +10,6 @@ pid_t getsid(pid_t p)
message m; message m;
memset(&m, 0, sizeof(m)); memset(&m, 0, sizeof(m));
m.PM_GETSID_PID = p; m.m_lc_pm_getsid.pid = p;
return(_syscall(PM_PROC_NR, PM_GETSID, &m)); return(_syscall(PM_PROC_NR, PM_GETSID, &m));
} }

View file

@ -69,7 +69,7 @@ int do_get()
case PM_GETSID: case PM_GETSID:
{ {
struct mproc *target; struct mproc *target;
pid_t p = m_in.PM_GETSID_PID; pid_t p = m_in.m_lc_pm_getsid.pid;
target = p ? find_proc(p) : &mproc[who_p]; target = p ? find_proc(p) : &mproc[who_p];
r = ESRCH; r = ESRCH;
if(target) if(target)