summaryrefslogtreecommitdiff
path: root/src/libstddjb/coe.c
blob: 9f9f184a6cfd58bd72854716b2c22c7545bbd936 (plain)
1
2
3
4
5
6
7
8
9
10
11
/* ISC license. */

#include <fcntl.h>
#include <skalibs/djbunix.h>

int coe (int fd)
{
  int flags = fcntl(fd, F_GETFD, 0) ;
  if (flags < 0) return -1 ;
  return fcntl(fd, F_SETFD, flags | FD_CLOEXEC) ;
}