summaryrefslogtreecommitdiff
path: root/nacl/curvecp/blocking.c
diff options
context:
space:
mode:
Diffstat (limited to 'nacl/curvecp/blocking.c')
-rw-r--r--nacl/curvecp/blocking.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/nacl/curvecp/blocking.c b/nacl/curvecp/blocking.c
new file mode 100644
index 00000000..1594259c
--- /dev/null
+++ b/nacl/curvecp/blocking.c
@@ -0,0 +1,12 @@
1#include <fcntl.h>
2#include "blocking.h"
3
4void blocking_enable(int fd)
5{
6 fcntl(fd,F_SETFL,fcntl(fd,F_GETFL,0) & ~O_NONBLOCK);
7}
8
9void blocking_disable(int fd)
10{
11 fcntl(fd,F_SETFL,fcntl(fd,F_GETFL,0) | O_NONBLOCK);
12}