https://github.com/bcgsc/ntCard
Raw File
Tip revision: c4aa22e5a5becb9d3aa31f82448f64d3be275e44 authored by Johnathan Wong on 25 September 2020, 23:47:52 UTC
release 1.2.2 (#45)
Tip revision: c4aa22e
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