AC_FUNC_STRCOLL
dnl Check for non-standard system calls
-AC_CHECK_FUNCS([accept4 dup3 eventfd vmsplice sched_getaffinity])
+AC_CHECK_FUNCS([accept4 dup3 pipe2 eventfd vmsplice sched_getaffinity])
AH_BOTTOM([#include <vlc_fixups.h>])
VLC_EXPORT( int, vlc_mkstemp, ( char * ) );
VLC_EXPORT( int, vlc_dup, ( int ) );
+VLC_EXPORT( int, vlc_pipe, ( int[2] ) );
#endif
vlc_unlink
vlc_rename
vlc_dup
+vlc_pipe
vlc_accept
utf8_vfprintf
var_AddCallback
return newfd;
}
+/**
+ * Creates a pipe (see "man pipe" for further reference).
+ */
+int vlc_pipe (int fds[2])
+{
+#ifdef HAVE_PIPE2
+ if (pipe2 (fds, O_CLOEXEC) == 0)
+ return 0;
+ if (errno != ENOSYS)
+ return -1;
+#endif
+
+ if (pipe (fds))
+ return -1;
+
+ fcntl (fds[0], F_SETFD, FD_CLOEXEC);
+ fcntl (fds[1], F_SETFD, FD_CLOEXEC);
+ return 0;
+}
+
#include <vlc_network.h>
/**
#endif
}
+int vlc_pipe (int fds[2])
+{
+ return _pipe (fds, 32768, O_BINARY);
+}
+
#include <vlc_network.h>
int vlc_socket (int pf, int type, int proto, bool nonblock)