src/posix的filesystem.c中
/**
* 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;
}
#ifdef __ANDROID__ /* && we support android < 2.3 */
/* pipe2() is declared and available since android-9 NDK,
* although it is available in libc.a since android-3
* We redefine the function here in order to be able to run