From: Lionel Sambuc Date: Mon, 12 May 2014 11:28:42 +0000 (+0200) Subject: Message type for VFS_PIPE2 X-Git-Tag: v3.3.0~312 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/doc/syslog.conf.5.html?a=commitdiff_plain;h=3bae8fe45ab2c49e8af098dcff56f251cb3068e1;p=minix.git Message type for VFS_PIPE2 Change-Id: I01c599cf035d8f103220baae54fefbc80d12fbd2 --- diff --git a/include/minix/callnr.h b/include/minix/callnr.h index 048e4db56..4ef3d790a 100644 --- a/include/minix/callnr.h +++ b/include/minix/callnr.h @@ -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 */ diff --git a/include/minix/ipc.h b/include/minix/ipc.h index 8f4077462..ad8b3fc06 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -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; diff --git a/lib/libc/sys-minix/pipe.c b/lib/libc/sys-minix/pipe.c index 552658cab..38e79664b 100644 --- a/lib/libc/sys-minix/pipe.c +++ b/lib/libc/sys-minix/pipe.c @@ -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); } diff --git a/servers/vfs/pipe.c b/servers/vfs/pipe.c index ea75afb07..047c392af 100644 --- a/servers/vfs/pipe.c +++ b/servers/vfs/pipe.c @@ -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;