https://github.com/bcgsc/ntCard
Tip revision: 9433d03872380c13bb131abf1e388e94862a4f15 authored by vlad0x00 on 05 January 2022, 21:31:33 UTC
Update formatting
Update formatting
Tip revision: 9433d03
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);
}