https://github.com/bcgsc/ntCard
Raw File
Tip revision: 741c9417282570a71c4042f0d2022493f26c4e49 authored by Johnathan Wong on 27 January 2020, 22:56:49 UTC
release 1.2.1 (#40)
Tip revision: 741c941
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