File: blocking.c

package info (click to toggle)
dq 20251001-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,376 kB
  • sloc: ansic: 13,644; python: 651; makefile: 382; sh: 336
file content (13 lines) | stat: -rw-r--r-- 291 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* taken from nacl-20110221, from curvecp/blocking.c (public domain) */
#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);
}