Sha256: 46ac526d1ab894dac3a61cd02ec074e2dec28e2f58a541cbe30a234edec66a69

Contents?: true

Size: 357 Bytes

Versions: 3

Compression:

Stored size: 357 Bytes

Contents

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

int open_write(const char *fn)
{
#ifdef O_CLOEXEC
  return open(fn,O_CREAT | O_WRONLY | O_NONBLOCK | O_CLOEXEC,0644);
#else
  int fd = open(fn,O_CREAT | O_WRONLY | O_NONBLOCK,0644);
  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_write.c
ruby_nacl-0.1.1 ext/ruby_nacl/NaCl/curvecp/open_write.c
ruby_nacl-0.1.0 ext/ruby_nacl/NaCl/curvecp/open_write.c