Message type for VFS_PIPE2

Change-Id: I01c599cf035d8f103220baae54fefbc80d12fbd2
This commit is contained in:
Lionel Sambuc 2014-05-12 13:28:42 +02:00
parent befa020a9e
commit 3bae8fe45a
4 changed files with 16 additions and 11 deletions

View file

@ -232,11 +232,6 @@
#define NR_VFS_CALLS 49 /* highest number from base plus one */
/* Field names for the pipe2(2) call. */
#define VFS_PIPE2_FD0 m1_i1 /* int */
#define VFS_PIPE2_FD1 m1_i2 /* int */
#define VFS_PIPE2_FLAGS m1_i3 /* int */
/* Field names for the umask(2) call. */
#define VFS_UMASK_MASK m1_i1 /* mode_t */

View file

@ -203,6 +203,15 @@ typedef struct {
} mess_lc_vfs_mount;
_ASSERT_MSG_SIZE(mess_lc_vfs_mount);
typedef struct {
int fd0;
int fd1;
int flags;
uint8_t padding[44];
} mess_lc_vfs_pipe2;
_ASSERT_MSG_SIZE(mess_lc_vfs_pipe2);
typedef struct {
uint32_t nfds;
fd_set *readfds;
@ -729,6 +738,7 @@ typedef struct {
mess_lc_vfs_ioctl m_lc_vfs_ioctl;
mess_lc_vfs_lseek m_lc_vfs_lseek;
mess_lc_vfs_mount m_lc_vfs_mount;
mess_lc_vfs_pipe2 m_lc_vfs_pipe2;
mess_lc_vfs_select m_lc_vfs_select;
mess_lc_vfs_statvfs1 m_lc_vfs_statvfs1;
mess_lc_vfs_truncate m_lc_vfs_truncate;

View file

@ -15,11 +15,11 @@ pipe2(int fild[2], int flags)
message m;
memset(&m, 0, sizeof(m));
m.VFS_PIPE2_FLAGS = flags;
m.m_lc_vfs_pipe2.flags = flags;
if (_syscall(VFS_PROC_NR, VFS_PIPE2, &m) < 0) return(-1);
fild[0] = m.VFS_PIPE2_FD0;
fild[1] = m.VFS_PIPE2_FD1;
fild[0] = m.m_lc_vfs_pipe2.fd0;
fild[1] = m.m_lc_vfs_pipe2.fd1;
return(0);
}

View file

@ -43,12 +43,12 @@ int do_pipe2(void)
int r, flags;
int fil_des[2]; /* reply goes here */
flags = job_m_in.VFS_PIPE2_FLAGS;
flags = job_m_in.m_lc_vfs_pipe2.flags;
r = create_pipe(fil_des, flags);
if (r == OK) {
job_m_out.VFS_PIPE2_FD0 = fil_des[0];
job_m_out.VFS_PIPE2_FD1 = fil_des[1];
job_m_out.m_lc_vfs_pipe2.fd0 = fil_des[0];
job_m_out.m_lc_vfs_pipe2.fd1 = fil_des[1];
}
return r;