Sha256: 1e622d34e532901f602a28b24992b63f8f2e5ff94a97eafdc8a677a5febfcd4f

Contents?: true

Size: 326 Bytes

Versions: 3

Compression:

Stored size: 326 Bytes

Contents

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include "open.h"

int open_read(const char *fn)
{
#ifdef O_CLOEXEC
  return open(fn,O_RDONLY | O_NONBLOCK | O_CLOEXEC);
#else
  int fd = open(fn,O_RDONLY | O_NONBLOCK);
  if (fd == -1) return -1;
  fcntl(fd,F_SETFD,1);
  return fd;
#endif
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ruby_nacl-0.1.2 ext/ruby_nacl/NaCl/curvecp/open_read.c
ruby_nacl-0.1.1 ext/ruby_nacl/NaCl/curvecp/open_read.c
ruby_nacl-0.1.0 ext/ruby_nacl/NaCl/curvecp/open_read.c