From: Lionel Sambuc Date: Tue, 13 May 2014 13:05:05 +0000 (+0200) Subject: Message type for PM_GETPID X-Git-Tag: v3.3.0~280 X-Git-Url: http://zhaoyanbai.com/repos/man.dnssec-revoke.html?a=commitdiff_plain;h=f63d2f0eafbbb416da37ed95c57b9ab8311f6015;p=minix.git Message type for PM_GETPID Change-Id: Ib3ff13ad9c9e30bde08d4cacb6905955ace73924 --- diff --git a/include/minix/callnr.h b/include/minix/callnr.h index 8cfc1fcf0..fa149aae2 100644 --- a/include/minix/callnr.h +++ b/include/minix/callnr.h @@ -85,9 +85,6 @@ #define PM_SIG_SET m2_sigset /* sigset_t */ #define PM_SIG_CTX m2_p1 /* struct sigcontext * */ -/* Field names for the getppid(2) call. */ -#define PM_GETPID_PARENT m2_i1 /* pid_t */ - /* Field names for the setsid(2) call. */ #define PM_GETSID_PID m1_i1 /* pid_t */ diff --git a/include/minix/ipc.h b/include/minix/ipc.h index 9906261a1..bdd1758ea 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -575,6 +575,13 @@ typedef struct { } mess_pm_lc_getgid; _ASSERT_MSG_SIZE(mess_pm_lc_getgid); +typedef struct { + pid_t parent_pid; + + uint8_t padding[52]; +} mess_pm_lc_getpid; +_ASSERT_MSG_SIZE(mess_pm_lc_getpid); + typedef struct { uid_t euid; @@ -1092,6 +1099,7 @@ typedef struct { mess_pm_lexec_exec_new m_pm_lexec_exec_new; mess_pm_lc_getgid m_pm_lc_getgid; + mess_pm_lc_getpid m_pm_lc_getpid; mess_pm_lc_getuid m_pm_lc_getuid; mess_pm_lc_ptrace m_pm_lc_ptrace; mess_pm_lc_time m_pm_lc_time; diff --git a/lib/libc/sys-minix/getppid.c b/lib/libc/sys-minix/getppid.c index 02c804ada..b3c58bdb0 100644 --- a/lib/libc/sys-minix/getppid.c +++ b/lib/libc/sys-minix/getppid.c @@ -15,6 +15,6 @@ pid_t getppid(void) * are not always successful and Minix returns the reserved value * (pid_t) -1 when there is an error. */ - if (_syscall(PM_PROC_NR, PM_GETPID, &m) < 0) return ( (pid_t) -1); - return( (pid_t) m.PM_GETPID_PARENT); + if (_syscall(PM_PROC_NR, PM_GETPID, &m) < 0) return(-1); + return(m.m_pm_lc_getpid.parent_pid); } diff --git a/servers/pm/getset.c b/servers/pm/getset.c index ac4f2f78c..b5263c033 100644 --- a/servers/pm/getset.c +++ b/servers/pm/getset.c @@ -59,7 +59,7 @@ int do_get() case PM_GETPID: r = mproc[who_p].mp_pid; - rmp->mp_reply.PM_GETPID_PARENT = mproc[rmp->mp_parent].mp_pid; + rmp->mp_reply.m_pm_lc_getpid.parent_pid = mproc[rmp->mp_parent].mp_pid; break; case PM_GETPGRP: