diff options
Diffstat (limited to 'nacl/curvecp/open_pipe.c')
-rw-r--r-- | nacl/curvecp/open_pipe.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/nacl/curvecp/open_pipe.c b/nacl/curvecp/open_pipe.c new file mode 100644 index 00000000..2fc2b1af --- /dev/null +++ b/nacl/curvecp/open_pipe.c | |||
@@ -0,0 +1,15 @@ | |||
1 | #include <unistd.h> | ||
2 | #include <fcntl.h> | ||
3 | #include "open.h" | ||
4 | #include "blocking.h" | ||
5 | |||
6 | int open_pipe(int *fd) | ||
7 | { | ||
8 | int i; | ||
9 | if (pipe(fd) == -1) return -1; | ||
10 | for (i = 0;i < 2;++i) { | ||
11 | fcntl(fd[i],F_SETFD,1); | ||
12 | blocking_disable(fd[i]); | ||
13 | } | ||
14 | return 0; | ||
15 | } | ||