1 #include <sys/cdefs.h> 2 #include "namespace.h" 3 #include <lib.h> 4 5 #include <string.h> 6 #include <unistd.h> 7 8 #ifdef __weak_alias 9 __weak_alias(pipe, _pipe) 10 #endif 11 12 int 13 pipe2(int fild[2], int flags) 14 { 15 message m; 16 17 memset(&m, 0, sizeof(m)); 18 m.m_lc_vfs_pipe2.flags = flags; 19 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); 24 } 25 26 int 27 pipe(int fild[2]) 28 { 29 return pipe2(fild, 0); 30 } 31