Side effects of open system call

Valdis.Kletnieks at vt.edu Valdis.Kletnieks at vt.edu
Thu Feb 20 10:36:58 EST 2014


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. :)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 848 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140220/fe6a987f/attachment.bin 


More information about the Kernelnewbies mailing list