skip to main | skip to sidebar

hotokblog

Sunday, June 21, 2009

fcntl() + Blocking

http://www.cplusplus.com/forum/unices/10016/

fcntl(fd, F_SETFL, O_NONBLOCK);

I have set up a socket file descriptor to non-blocking mode using fcntl() function call. Now how do I set this back to blocking mode?

int flags = fcntl(fd, F_GETFL);
int result = fcntl(fd, F_SETFL, flags & ~O_NONBLOCK);
Posted by hotokblog at 5:53 PM

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Blog Archive

  • ►  2026 (1)
    • ►  January (1)
  • ►  2017 (1)
    • ►  September (1)
  • ►  2016 (1)
    • ►  January (1)
  • ►  2013 (1)
    • ►  November (1)
  • ►  2012 (5)
    • ►  November (1)
    • ►  February (1)
    • ►  January (3)
  • ►  2011 (4)
    • ►  August (1)
    • ►  July (3)
  • ►  2010 (6)
    • ►  June (2)
    • ►  May (2)
    • ►  April (2)
  • ▼  2009 (26)
    • ►  September (1)
    • ►  August (2)
    • ►  July (1)
    • ▼  June (4)
      • reading from a pipe blocks when there is no more t...
      • fcntl() + Blocking
      • Creating Pipes in C
      • Simple encryption using XOR in C/C++
    • ►  May (1)
    • ►  April (9)
    • ►  March (7)
    • ►  February (1)
  • ►  2008 (3)
    • ►  October (1)
    • ►  September (2)
  • ►  2007 (5)
    • ►  December (3)
    • ►  November (1)
    • ►  April (1)

About Me

hotokblog
View my complete profile