src/utils/unix_utils.c
/** 
 * Creates a unidirectional pipe.
 * @param fds Int arr of size 2.
 * @param fd0 WRITE
 * @param fd1 READ
 * @note On error check errno! Also pipes are more logically reveresed,
 * 0 was reading and 1 was writing.
 */
Creates a unidirectional pipe.
@param fds Int arr of size 2.
@param fd0 WRITE
@param fd1 READ
@note On error check errno. Also pipes are more logically reveresed,
0 was reading and 1 was writing.
Creates a unidirectional pipe . @param fds Int arr of size 2 . @param fd0 WRITE @param fd1 READ @note On error check errno . Also pipes are more logically reveresed 0 was reading and 1 was writing .
t_bool	ft_pipe(t_i32 fds[2])
{
	t_i32	temp;
	if (pipe(fds) == -1)
		return (false);
	temp = fds[0];
	fds[0] = fds[1];
	fds[1] = temp;
	return (true);
}
t_bool ft_pipe ( t_i32 fds [ 2 ] ) { t_i32 temp ; if ( pipe ( fds ) == -1 ) return ( false ) ; temp = fds [ 0 ] ; fds [ 0 ] = fds [ 1 ] ; fds [ 1 ] = temp ; return ( true ) ; }
Creates a unidirectional pipe.
Creates a unidirectional pipe .