From 6495d409d67125adf899aee7765506285c5fdff1 Mon Sep 17 00:00:00 2001 From: Lionel Sambuc Date: Tue, 13 May 2014 17:33:27 +0200 Subject: [PATCH] Message type for PM_EXIT Change-Id: Ie78768d95358a701268129587074a48493cf5bbc --- include/minix/callnr.h | 3 --- include/minix/ipc.h | 8 ++++++++ lib/libc/sys-minix/_exit.c | 2 +- servers/pm/forkexit.c | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/include/minix/callnr.h b/include/minix/callnr.h index d25acace8..76c278d4b 100644 --- a/include/minix/callnr.h +++ b/include/minix/callnr.h @@ -61,9 +61,6 @@ #define NR_PM_CALLS 48 /* highest number from base plus one */ -/* Field names for the exit(2) call. */ -#define PM_EXIT_STATUS m1_i1 /* int */ - /* Field names for the kill(2), srv_kill(2), and sigaction(2) calls. */ #define PM_SIG_PID m1_i1 /* pid_t */ #define PM_SIG_NR m1_i2 /* int */ diff --git a/include/minix/ipc.h b/include/minix/ipc.h index c2d9d6790..39ca32d9f 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -156,6 +156,13 @@ typedef struct { } mess_lc_pm_exec; _ASSERT_MSG_SIZE(mess_lc_pm_exec); +typedef struct { + int status; + + uint8_t padding[52]; +} mess_lc_pm_exit; +_ASSERT_MSG_SIZE(mess_lc_pm_exit); + typedef struct { pid_t pid; @@ -1076,6 +1083,7 @@ typedef struct { mess_fs_vfs_readwrite m_fs_vfs_readwrite; mess_lc_pm_exec m_lc_pm_exec; + mess_lc_pm_exit m_lc_pm_exit; mess_lc_pm_getsid m_lc_pm_getsid; mess_lc_pm_groups m_lc_pm_groups; mess_lc_pm_itimer m_lc_pm_itimer; diff --git a/lib/libc/sys-minix/_exit.c b/lib/libc/sys-minix/_exit.c index 2eff9f661..535adbef6 100644 --- a/lib/libc/sys-minix/_exit.c +++ b/lib/libc/sys-minix/_exit.c @@ -16,7 +16,7 @@ int status; message m; memset(&m, 0, sizeof(m)); - m.PM_EXIT_STATUS = status; + m.m_lc_pm_exit.status = status; _syscall(PM_PROC_NR, PM_EXIT, &m); /* If exiting nicely through PM fails for some reason, try to diff --git a/servers/pm/forkexit.c b/servers/pm/forkexit.c index 9e714fd6a..a221d3c9f 100644 --- a/servers/pm/forkexit.c +++ b/servers/pm/forkexit.c @@ -241,7 +241,7 @@ int do_exit() sys_kill(mp->mp_endpoint, SIGKILL); } else { - exit_proc(mp, m_in.PM_EXIT_STATUS, FALSE /*dump_core*/); + exit_proc(mp, m_in.m_lc_pm_exit.status, FALSE /*dump_core*/); } return(SUSPEND); /* can't communicate from beyond the grave */ } -- 2.44.0