https://github.com/bcgsc/ntCard
Revision de4252db866b8cf232fd746d94ad49de7ce02c03 authored by Hamid Mohamadi on 11 January 2017, 21:01:42 UTC, committed by GitHub on 11 January 2017, 21:01:42 UTC
1 parent 86d28c1
Raw File
Tip revision: de4252db866b8cf232fd746d94ad49de7ce02c03 authored by Hamid Mohamadi on 11 January 2017, 21:01:42 UTC
Update README.md
Tip revision: de4252d
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