From: Lionel Sambuc Date: Mon, 12 May 2014 15:05:32 +0000 (+0200) Subject: Message type for VFS_FCHMOD X-Git-Tag: v3.3.0~300 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/roff.3.ps?a=commitdiff_plain;h=6c61cd5665378edee74462eb4f32f4a903accf44;p=minix.git Message type for VFS_FCHMOD Change-Id: I933e5b5a214aa9e7ddb6546b459ef40688e8ca04 --- diff --git a/include/minix/callnr.h b/include/minix/callnr.h index 7548a1e85..cf052dbc9 100644 --- a/include/minix/callnr.h +++ b/include/minix/callnr.h @@ -232,10 +232,6 @@ #define NR_VFS_CALLS 49 /* highest number from base plus one */ -/* Field names for the fchmod(2) call. */ -#define VFS_FCHMOD_FD m1_i1 /* int */ -#define VFS_FCHMOD_MODE m1_i2 /* mode_t */ - /* Field names for the close(2) call. */ #define VFS_CLOSE_FD m1_i1 /* int */ diff --git a/include/minix/ipc.h b/include/minix/ipc.h index 8f9278f4a..37bfdfffe 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -173,6 +173,14 @@ typedef struct { } mess_lc_vfs_fchdir; _ASSERT_MSG_SIZE(mess_lc_vfs_fchdir); +typedef struct { + int fd; + mode_t mode; + + uint8_t padding[48]; +} mess_lc_vfs_fchmod; +_ASSERT_MSG_SIZE(mess_lc_vfs_fchmod); + typedef struct { int fd; int cmd; @@ -837,6 +845,7 @@ typedef struct { mess_lc_vfs_chown m_lc_vfs_chown; mess_lc_vfs_creat m_lc_vfs_creat; mess_lc_vfs_fchdir m_lc_vfs_fchdir; + mess_lc_vfs_fchmod m_lc_vfs_fchmod; mess_lc_vfs_fcntl m_lc_vfs_fcntl; mess_lc_vfs_fstat m_lc_vfs_fstat; mess_lc_vfs_fsync m_lc_vfs_fsync; diff --git a/lib/libc/sys-minix/fchmod.c b/lib/libc/sys-minix/fchmod.c index bb58cb443..7e0134daf 100644 --- a/lib/libc/sys-minix/fchmod.c +++ b/lib/libc/sys-minix/fchmod.c @@ -10,7 +10,7 @@ int fchmod(int fd, mode_t mode) message m; memset(&m, 0, sizeof(m)); - m.VFS_FCHMOD_FD = fd; - m.VFS_FCHMOD_MODE = mode; + m.m_lc_vfs_fchmod.fd = fd; + m.m_lc_vfs_fchmod.mode = mode; return(_syscall(VFS_PROC_NR, VFS_FCHMOD, &m)); } diff --git a/servers/vfs/protect.c b/servers/vfs/protect.c index 7bee28a7f..f36b71800 100644 --- a/servers/vfs/protect.c +++ b/servers/vfs/protect.c @@ -50,8 +50,8 @@ int do_chmod(void) return(err_code); if ((vp = eat_path(&resolve, fp)) == NULL) return(err_code); } else { /* call_nr == VFS_FCHMOD */ - rfd = job_m_in.VFS_FCHMOD_FD; - new_mode = (mode_t) job_m_in.VFS_FCHMOD_MODE; + rfd = job_m_in.m_lc_vfs_fchmod.fd; + new_mode = job_m_in.m_lc_vfs_fchmod.mode; /* File is already opened; get a pointer to vnode from filp. */ if ((flp = get_filp(rfd, VNODE_WRITE)) == NULL) return(err_code); vp = flp->filp_vno;