Message type for PM_GETPID
Change-Id: Ib3ff13ad9c9e30bde08d4cacb6905955ace73924
This commit is contained in:
parent
cc852e7783
commit
f63d2f0eaf
4 changed files with 11 additions and 6 deletions
|
@ -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 */
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue