2011-02-17 18:11:09 +01:00
|
|
|
#include <sys/cdefs.h>
|
|
|
|
#include "namespace.h"
|
|
|
|
#include <lib.h>
|
|
|
|
|
2013-11-04 22:48:08 +01:00
|
|
|
#include <string.h>
|
2011-02-17 18:11:09 +01:00
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
#ifdef __weak_alias
|
|
|
|
__weak_alias(pipe, _pipe)
|
2013-02-25 15:45:22 +01:00
|
|
|
__weak_alias(pipe2, _pipe2)
|
2011-02-17 18:11:09 +01:00
|
|
|
#endif
|
|
|
|
|
2013-02-25 15:45:22 +01:00
|
|
|
int
|
2013-11-04 22:48:08 +01:00
|
|
|
pipe2(int fild[2], int flags)
|
2011-02-17 18:11:09 +01:00
|
|
|
{
|
2013-02-25 15:45:22 +01:00
|
|
|
message m;
|
2011-02-17 18:11:09 +01:00
|
|
|
|
2013-11-04 22:48:08 +01:00
|
|
|
memset(&m, 0, sizeof(m));
|
|
|
|
m.VFS_PIPE2_FLAGS = flags;
|
|
|
|
|
|
|
|
if (_syscall(VFS_PROC_NR, VFS_PIPE2, &m) < 0) return(-1);
|
|
|
|
fild[0] = m.VFS_PIPE2_FD0;
|
|
|
|
fild[1] = m.VFS_PIPE2_FD1;
|
2013-02-25 15:45:22 +01:00
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2013-11-04 22:48:08 +01:00
|
|
|
pipe(int fild[2])
|
2013-02-25 15:45:22 +01:00
|
|
|
{
|
2013-11-04 22:48:08 +01:00
|
|
|
return pipe2(fild, 0);
|
2011-02-17 18:11:09 +01:00
|
|
|
}
|