summaryrefslogtreecommitdiff
path: root/nacl/curvecp/open_pipe.c
blob: 2fc2b1af305eac539c55e013a1470236b778875c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <unistd.h>
#include <fcntl.h>
#include "open.h"
#include "blocking.h"

int open_pipe(int *fd)
{
  int i;
  if (pipe(fd) == -1) return -1;
  for (i = 0;i < 2;++i) {
    fcntl(fd[i],F_SETFD,1);
    blocking_disable(fd[i]);
  }
  return 0;
}