Question: is fcntl a blocking call?
Answer: fcntl() or ioctl() are used to set the properties for file streams. When you use this function to make a socket non-blocking, function like accept() , recv() and etc, which are blocking in nature will return error and errno would be set to EWOULDBLOCK . You can poll file descriptor sets to poll on sockets.