How many times open and release function is called of a character driver after fork
Consider the /dev/msg which we created in our previous post, what if the test application created fork(), let's see how many times the open and close function will be called.
Test Application Code:
Output:
Notes:
The open and release function is only called once.
When you do fork(), it will not create a new file structure and close() will call the release method of the driver only when the counter of the file structure becomes zero.
Test Application Code:
Output:
Notes:
The open and release function is only called once.
When you do fork(), it will not create a new file structure and close() will call the release method of the driver only when the counter of the file structure becomes zero.
Comments
Post a Comment