How do i unset a already set flag using fcntl?
For e.g. I can set the socket to nonblocking mode using
fcntl(sockfd, F_SETFL, flags | O_NONBLOCK)
Now, i want to unset the O_NONBLOCK flag.
I tried fcntl(sockfd, F_SETFL, flags | ~O_NONBLOCK). It gave me error EINVAL