Message type for VFS_FSTAT

Change-Id: Ibdedcac120fc4bf78e28291d9c97fe02df1928db
This commit is contained in:
Lionel Sambuc 2014-05-12 14:19:05 +02:00
parent cd0fd5e725
commit bb2b07940c
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 */ #define NR_VFS_CALLS 49 /* highest number from base plus one */
/* Field names for the fstat(2) call. */
#define VFS_FSTAT_FD m1_i1 /* int */
#define VFS_FSTAT_BUF m1_p1 /* struct stat * */
/* Field names for the fcntl(2) call. */ /* Field names for the fcntl(2) call. */
#define VFS_FCNTL_FD m1_i1 /* int */ #define VFS_FCNTL_FD m1_i1 /* int */
#define VFS_FCNTL_CMD m1_i2 /* int */ #define VFS_FCNTL_CMD m1_i2 /* int */

View file

@ -146,6 +146,14 @@ typedef struct {
} mess_sigcalls; } mess_sigcalls;
_ASSERT_MSG_SIZE(mess_sigcalls); _ASSERT_MSG_SIZE(mess_sigcalls);
typedef struct {
int fd;
vir_bytes buf; /* struct stat * */
uint8_t padding[48];
} mess_lc_vfs_fstat;
_ASSERT_MSG_SIZE(mess_lc_vfs_fstat);
typedef struct { typedef struct {
int fd; int fd;
@ -769,6 +777,7 @@ typedef struct {
mess_fs_vfs_readsuper m_fs_vfs_readsuper; mess_fs_vfs_readsuper m_fs_vfs_readsuper;
mess_fs_vfs_readwrite m_fs_vfs_readwrite; mess_fs_vfs_readwrite m_fs_vfs_readwrite;
mess_lc_vfs_fstat m_lc_vfs_fstat;
mess_lc_vfs_fsync m_lc_vfs_fsync; mess_lc_vfs_fsync m_lc_vfs_fsync;
mess_lc_vfs_getvfsstat m_lc_vfs_getvfsstat; mess_lc_vfs_getvfsstat m_lc_vfs_getvfsstat;
mess_lc_vfs_ioctl m_lc_vfs_ioctl; mess_lc_vfs_ioctl m_lc_vfs_ioctl;

View file

@ -32,8 +32,8 @@ int fstat(int fd, struct stat *buffer)
message m; message m;
memset(&m, 0, sizeof(m)); memset(&m, 0, sizeof(m));
m.VFS_FSTAT_FD = fd; m.m_lc_vfs_fstat.fd = fd;
m.VFS_FSTAT_BUF = (char *) buffer; m.m_lc_vfs_fstat.buf = (vir_bytes)buffer;
return _syscall(VFS_PROC_NR, VFS_FSTAT, &m); return _syscall(VFS_PROC_NR, VFS_FSTAT, &m);
} }

View file

@ -177,8 +177,8 @@ int do_fstat(void)
int r, rfd; int r, rfd;
vir_bytes statbuf; vir_bytes statbuf;
statbuf = (vir_bytes) job_m_in.VFS_FSTAT_BUF; statbuf = job_m_in.m_lc_vfs_fstat.buf;
rfd = job_m_in.VFS_FSTAT_FD; rfd = job_m_in.m_lc_vfs_fstat.fd;
/* Is the file descriptor valid? */ /* Is the file descriptor valid? */
if ((rfilp = get_filp(rfd, VNODE_READ)) == NULL) return(err_code); if ((rfilp = get_filp(rfd, VNODE_READ)) == NULL) return(err_code);