1433d6423SLionel Sambuc #include <sys/cdefs.h> 2433d6423SLionel Sambuc #include "namespace.h" 3433d6423SLionel Sambuc #include <lib.h> 4433d6423SLionel Sambuc 5433d6423SLionel Sambuc #include <string.h> 6433d6423SLionel Sambuc #include <unistd.h> 7433d6423SLionel Sambuc 8433d6423SLionel Sambuc #ifdef __weak_alias __weak_alias(pipe,_pipe)9433d6423SLionel Sambuc__weak_alias(pipe, _pipe) 10433d6423SLionel Sambuc #endif 11433d6423SLionel Sambuc 12433d6423SLionel Sambuc int 13433d6423SLionel Sambuc pipe2(int fild[2], int flags) 14433d6423SLionel Sambuc { 15433d6423SLionel Sambuc message m; 16433d6423SLionel Sambuc 17433d6423SLionel Sambuc memset(&m, 0, sizeof(m)); 18433d6423SLionel Sambuc m.m_lc_vfs_pipe2.flags = flags; 19*c33d6ef3SDavid van Moolenbroek m.m_lc_vfs_pipe2.oflags = flags; /* backward compatibility */ 20433d6423SLionel Sambuc 21433d6423SLionel Sambuc if (_syscall(VFS_PROC_NR, VFS_PIPE2, &m) < 0) return(-1); 22*c33d6ef3SDavid van Moolenbroek fild[0] = m.m_vfs_lc_fdpair.fd0; 23*c33d6ef3SDavid van Moolenbroek fild[1] = m.m_vfs_lc_fdpair.fd1; 24433d6423SLionel Sambuc return(0); 25433d6423SLionel Sambuc } 26433d6423SLionel Sambuc 27433d6423SLionel Sambuc int pipe(int fild[2])28433d6423SLionel Sambucpipe(int fild[2]) 29433d6423SLionel Sambuc { 30433d6423SLionel Sambuc return pipe2(fild, 0); 31433d6423SLionel Sambuc } 32