blob: 1594259c2cd84188c12ca5ac302bbf60e1ac4d4c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
#include <fcntl.h>
#include "blocking.h"
void blocking_enable(int fd)
{
fcntl(fd,F_SETFL,fcntl(fd,F_GETFL,0) & ~O_NONBLOCK);
}
void blocking_disable(int fd)
{
fcntl(fd,F_SETFL,fcntl(fd,F_GETFL,0) | O_NONBLOCK);
}
|