Feb. 20, 2014
3:36 p.m.
On Thu, 20 Feb 2014 20:36:44 +0530, Rahul Bedarkar said:
"Often the open(2) call has unwanted side effects, that can be avoided under Linux by giving it the O_NONBLOCK flag."
I have seen open man page but can't find what are side effects of open.
Well, for starters, the open() call can block while trying to open a hardware device that isnt ready, thus hanging the entire process. For added joy, remember that signals are delivered when a process inside a syscall finally returns to userspace - which means that your hung process may be unkillable even by 'kill -9'. Most people would call that an unwanted side effect. :)