/* First we have a helper routine which tells is if from this file descriptor (ie. the /dev/net/tun device) will block:  */
static bool will_block(int fd)
/* First we have a helper routine which tells is if from this file descriptor (ie. the /dev/net/tun device) will block:  */
static bool will_block(int fd)
{
	fd_set fdset;
	struct timeval zero = { 0, 0 };
	FD_ZERO(&fdset);
	FD_SET(fd, &fdset);
	return select(fd+1, &fdset, NULL, NULL, &zero) != 1;
}