From: Lionel Sambuc Date: Tue, 13 May 2014 14:36:03 +0000 (+0200) Subject: Message type for PM_EXEC X-Git-Tag: v3.3.0~277 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/Bv9ARM.ch13.html?a=commitdiff_plain;h=048d0f0d62a7090122be6b6524ca18e95b6ddefc;p=minix.git Message type for PM_EXEC Change-Id: I6738716ba835d6196519056bb77afa8ec99f122a --- diff --git a/include/minix/callnr.h b/include/minix/callnr.h index 1f7d7434d..d25acace8 100644 --- a/include/minix/callnr.h +++ b/include/minix/callnr.h @@ -64,13 +64,6 @@ /* Field names for the exit(2) call. */ #define PM_EXIT_STATUS m1_i1 /* int */ -/* Field names for the execve(2) call. */ -#define PM_EXEC_NAME m1_p1 /* const char * */ -#define PM_EXEC_NAMELEN m1_i1 /* size_t */ -#define PM_EXEC_FRAME m1_p2 /* char * */ -#define PM_EXEC_FRAMELEN m1_i2 /* size_t */ -#define PM_EXEC_PS_STR m1_p3 /* char * */ - /* 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 487d8d0d1..c2d9d6790 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -145,6 +145,17 @@ typedef struct { } mess_sigcalls; _ASSERT_MSG_SIZE(mess_sigcalls); +typedef struct { + vir_bytes name; + size_t namelen; + vir_bytes frame; + size_t framelen; + vir_bytes ps_str; + + uint8_t padding[36]; +} mess_lc_pm_exec; +_ASSERT_MSG_SIZE(mess_lc_pm_exec); + typedef struct { pid_t pid; @@ -1064,6 +1075,7 @@ typedef struct { mess_fs_vfs_readsuper m_fs_vfs_readsuper; mess_fs_vfs_readwrite m_fs_vfs_readwrite; + mess_lc_pm_exec m_lc_pm_exec; 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/execve.c b/lib/libc/sys-minix/execve.c index 7ace7556d..04420060c 100644 --- a/lib/libc/sys-minix/execve.c +++ b/lib/libc/sys-minix/execve.c @@ -44,11 +44,11 @@ int execve(const char *path, char * const *argv, char * const *envp) memset(&m, 0, sizeof(m)); /* We can finally make the system call. */ - m.PM_EXEC_NAME = (char *) __UNCONST(path); - m.PM_EXEC_NAMELEN = strlen(path) + 1; - m.PM_EXEC_FRAME = frame; - m.PM_EXEC_FRAMELEN = frame_size; - m.PM_EXEC_PS_STR = (char *)(vsp + ((char *)psp - frame)); + m.m_lc_pm_exec.name = (vir_bytes)path; + m.m_lc_pm_exec.namelen = strlen(path) + 1; + m.m_lc_pm_exec.frame = (vir_bytes)frame; + m.m_lc_pm_exec.framelen = frame_size; + m.m_lc_pm_exec.ps_str = (vir_bytes)(vsp + ((char *)psp - frame)); (void) _syscall(PM_PROC_NR, PM_EXEC, &m); diff --git a/servers/pm/exec.c b/servers/pm/exec.c index b50d893c4..5e6b3ad35 100644 --- a/servers/pm/exec.c +++ b/servers/pm/exec.c @@ -42,11 +42,11 @@ int do_exec() memset(&m, 0, sizeof(m)); m.m_type = VFS_PM_EXEC; m.VFS_PM_ENDPT = mp->mp_endpoint; - m.VFS_PM_PATH = m_in.PM_EXEC_NAME; - m.VFS_PM_PATH_LEN = m_in.PM_EXEC_NAMELEN; - m.VFS_PM_FRAME = m_in.PM_EXEC_FRAME; - m.VFS_PM_FRAME_LEN = m_in.PM_EXEC_FRAMELEN; - m.VFS_PM_PS_STR = (vir_bytes) m_in.PM_EXEC_PS_STR; + m.VFS_PM_PATH = (void *)m_in.m_lc_pm_exec.name; + m.VFS_PM_PATH_LEN = m_in.m_lc_pm_exec.namelen; + m.VFS_PM_FRAME = (void *)m_in.m_lc_pm_exec.frame; + m.VFS_PM_FRAME_LEN = m_in.m_lc_pm_exec.framelen; + m.VFS_PM_PS_STR = m_in.m_lc_pm_exec.ps_str; tell_vfs(mp, &m);