/*************************************************************** SYS-PIPE2.C This file contains Linux/i386/ILP32 implementation of __cpu_sys_pipe2(). PART OF : CPU - library . USAGE : Internal only . Copyright (C) 2026 by Andrew V.Kosteltsev. All Rights Reserved. ***************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include __mpu_int64_t __cpu_sys_pipe2( int pipefd[2], __mpu_uint64_t flags ) { int host_flags = 0; int ret; if( !pipefd ) return( -(__mpu_int64_t)__MCPU_EINVAL ); if( flags & ~(__mpu_uint64_t)__CPU_O_NONBLOCK ) return( -(__mpu_int64_t)__MCPU_EINVAL ); if( flags & __CPU_O_NONBLOCK ) host_flags |= O_NONBLOCK; ret = pipe2( pipefd, host_flags ); if( ret < 0 ) return( -(__mpu_int64_t)__cpu_errno_from_host( errno ) ); return( 0 ); } /* End of __cpu_sys_pipe2() */