Message type for VFS_{,L}STAT
Change-Id: I61db8484c14f0371214a0495774dc0b1d97f2099
This commit is contained in:
parent
c5b1fc6f0d
commit
cd0fd5e725
4 changed files with 22 additions and 17 deletions
|
@ -232,11 +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 stat(2) and lstat(2) calls. */
|
|
||||||
#define VFS_STAT_NAME m1_p1 /* const char * */
|
|
||||||
#define VFS_STAT_LEN m1_i1 /* size_t */
|
|
||||||
#define VFS_STAT_BUF m1_p2 /* struct stat * */
|
|
||||||
|
|
||||||
/* Field names for the fstat(2) call. */
|
/* Field names for the fstat(2) call. */
|
||||||
#define VFS_FSTAT_FD m1_i1 /* int */
|
#define VFS_FSTAT_FD m1_i1 /* int */
|
||||||
#define VFS_FSTAT_BUF m1_p1 /* struct stat * */
|
#define VFS_FSTAT_BUF m1_p1 /* struct stat * */
|
||||||
|
|
|
@ -243,6 +243,15 @@ typedef struct {
|
||||||
} mess_lc_vfs_select;
|
} mess_lc_vfs_select;
|
||||||
_ASSERT_MSG_SIZE(mess_lc_vfs_select);
|
_ASSERT_MSG_SIZE(mess_lc_vfs_select);
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
size_t len;
|
||||||
|
vir_bytes name; /* const char * */
|
||||||
|
vir_bytes buf; /* struct stat * */
|
||||||
|
|
||||||
|
uint8_t padding[44];
|
||||||
|
} mess_lc_vfs_stat;
|
||||||
|
_ASSERT_MSG_SIZE(mess_lc_vfs_stat);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int fd;
|
int fd;
|
||||||
int flags;
|
int flags;
|
||||||
|
@ -769,6 +778,7 @@ typedef struct {
|
||||||
mess_lc_vfs_pipe2 m_lc_vfs_pipe2;
|
mess_lc_vfs_pipe2 m_lc_vfs_pipe2;
|
||||||
mess_lc_vfs_readlink m_lc_vfs_readlink;
|
mess_lc_vfs_readlink m_lc_vfs_readlink;
|
||||||
mess_lc_vfs_select m_lc_vfs_select;
|
mess_lc_vfs_select m_lc_vfs_select;
|
||||||
|
mess_lc_vfs_stat m_lc_vfs_stat;
|
||||||
mess_lc_vfs_statvfs1 m_lc_vfs_statvfs1;
|
mess_lc_vfs_statvfs1 m_lc_vfs_statvfs1;
|
||||||
mess_lc_vfs_truncate m_lc_vfs_truncate;
|
mess_lc_vfs_truncate m_lc_vfs_truncate;
|
||||||
mess_lc_vfs_umask m_lc_vfs_umask;
|
mess_lc_vfs_umask m_lc_vfs_umask;
|
||||||
|
|
|
@ -20,9 +20,9 @@ int stat(const char *name, struct stat *buffer)
|
||||||
message m;
|
message m;
|
||||||
|
|
||||||
memset(&m, 0, sizeof(m));
|
memset(&m, 0, sizeof(m));
|
||||||
m.VFS_STAT_LEN = strlen(name) + 1;
|
m.m_lc_vfs_stat.len = strlen(name) + 1;
|
||||||
m.VFS_STAT_NAME = (char *) __UNCONST(name);
|
m.m_lc_vfs_stat.name = (vir_bytes)name;
|
||||||
m.VFS_STAT_BUF = (char *) buffer;
|
m.m_lc_vfs_stat.buf = (vir_bytes)buffer;
|
||||||
|
|
||||||
return _syscall(VFS_PROC_NR, VFS_STAT, &m);
|
return _syscall(VFS_PROC_NR, VFS_STAT, &m);
|
||||||
}
|
}
|
||||||
|
@ -43,9 +43,9 @@ int lstat(const char *name, struct stat *buffer)
|
||||||
message m;
|
message m;
|
||||||
|
|
||||||
memset(&m, 0, sizeof(m));
|
memset(&m, 0, sizeof(m));
|
||||||
m.VFS_STAT_LEN = strlen(name) + 1;
|
m.m_lc_vfs_stat.len = strlen(name) + 1;
|
||||||
m.VFS_STAT_NAME = (char *) __UNCONST(name);
|
m.m_lc_vfs_stat.name = (vir_bytes)name;
|
||||||
m.VFS_STAT_BUF = (char *) buffer;
|
m.m_lc_vfs_stat.buf = (vir_bytes)buffer;
|
||||||
|
|
||||||
return _syscall(VFS_PROC_NR, VFS_LSTAT, &m);
|
return _syscall(VFS_PROC_NR, VFS_LSTAT, &m);
|
||||||
}
|
}
|
||||||
|
|
|
@ -148,9 +148,9 @@ int do_stat(void)
|
||||||
vir_bytes vname1, statbuf;
|
vir_bytes vname1, statbuf;
|
||||||
size_t vname1_length;
|
size_t vname1_length;
|
||||||
|
|
||||||
vname1 = (vir_bytes) job_m_in.VFS_STAT_NAME;
|
vname1 = job_m_in.m_lc_vfs_stat.name;
|
||||||
vname1_length = (size_t) job_m_in.VFS_STAT_LEN;
|
vname1_length = job_m_in.m_lc_vfs_stat.len;
|
||||||
statbuf = (vir_bytes) job_m_in.VFS_STAT_BUF;
|
statbuf = job_m_in.m_lc_vfs_stat.buf;
|
||||||
|
|
||||||
lookup_init(&resolve, fullpath, PATH_NOFLAGS, &vmp, &vp);
|
lookup_init(&resolve, fullpath, PATH_NOFLAGS, &vmp, &vp);
|
||||||
resolve.l_vmnt_lock = VMNT_READ;
|
resolve.l_vmnt_lock = VMNT_READ;
|
||||||
|
@ -426,9 +426,9 @@ int do_lstat(void)
|
||||||
vir_bytes vname1, statbuf;
|
vir_bytes vname1, statbuf;
|
||||||
size_t vname1_length;
|
size_t vname1_length;
|
||||||
|
|
||||||
vname1 = (vir_bytes) job_m_in.VFS_STAT_NAME;
|
vname1 = job_m_in.m_lc_vfs_stat.name;
|
||||||
vname1_length = (size_t) job_m_in.VFS_STAT_LEN;
|
vname1_length = job_m_in.m_lc_vfs_stat.len;
|
||||||
statbuf = (vir_bytes) job_m_in.VFS_STAT_BUF;
|
statbuf = job_m_in.m_lc_vfs_stat.buf;
|
||||||
|
|
||||||
lookup_init(&resolve, fullpath, PATH_RET_SYMLINK, &vmp, &vp);
|
lookup_init(&resolve, fullpath, PATH_RET_SYMLINK, &vmp, &vp);
|
||||||
resolve.l_vmnt_lock = VMNT_READ;
|
resolve.l_vmnt_lock = VMNT_READ;
|
||||||
|
|
Loading…
Reference in a new issue