https://github.com/bcgsc/ntCard
Raw File
Tip revision: c9e66cc2870ea68f5a0905f9417a1935ae3a1ae1 authored by mohamadi on 12 October 2018, 22:15:45 UTC
README and version updated to 1.1.0
Tip revision: c9e66cc
Fcontrol.cpp
#include "Fcontrol.h"
#include <fcntl.h>

/* Set the FD_CLOEXEC flag of the specified file descriptor. */
int setCloexec(int fd)
{
    int flags = fcntl(fd, F_GETFD, 0);
    if (flags == -1)
        return -1;
    flags |= FD_CLOEXEC;
    return fcntl(fd, F_SETFD, flags);
}
back to top