def setBlocking(fd): """Make a fd blocking.""" flags = fcntl.fcntl(fd, FCNTL.F_GETFL) flags = flags & ~os.O_NONBLOCK fcntl.fcntl(fd, FCNTL.F_SETFL, flags)