summaryrefslogtreecommitdiff
path: root/src/libstddjb/coe.c
blob: a12f9cbb8dc5dcdff03664ca0168faa073a9a92d (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)
{
   register int flags = fcntl(fd, F_GETFD, 0) ;
   if (flags < 0) return -1 ;
   return fcntl(fd, F_SETFD, flags | FD_CLOEXEC) ;
}