https://github.com/bcgsc/ntCard
Raw File
Tip revision: fb05b3253ede3a327732bc4de37a96b91253e447 authored by mohamadi on 17 August 2017, 16:44:37 UTC
Changing License to MIT
Tip revision: fb05b32
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