custom message type for VM_QUERY_EXIT
[minix3.git] / lib / libc / sys-minix / pipe.c
blob38e79664b82564f55636d25b08e2ea2524daaa9c
1 #include <sys/cdefs.h>
2 #include "namespace.h"
3 #include <lib.h>
5 #include <string.h>
6 #include <unistd.h>
8 #ifdef __weak_alias
9 __weak_alias(pipe, _pipe)
10 #endif
12 int
13 pipe2(int fild[2], int flags)
15 message m;
17 memset(&m, 0, sizeof(m));
18 m.m_lc_vfs_pipe2.flags = flags;
20 if (_syscall(VFS_PROC_NR, VFS_PIPE2, &m) < 0) return(-1);
21 fild[0] = m.m_lc_vfs_pipe2.fd0;
22 fild[1] = m.m_lc_vfs_pipe2.fd1;
23 return(0);
26 int
27 pipe(int fild[2])
29 return pipe2(fild, 0);