Message type for VFS_FCHMOD

Change-Id: I933e5b5a214aa9e7ddb6546b459ef40688e8ca04
This commit is contained in:
Lionel Sambuc 2014-05-12 17:05:32 +02:00
parent 4635162db2
commit 6c61cd5665
4 changed files with 13 additions and 8 deletions

View file

@ -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 */

View file

@ -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;

View file

@ -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));
}

View file

@ -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;