Preventing threads from writing to the same file
Posted
by EpsilonVector
on Stack Overflow
See other posts from Stack Overflow
or by EpsilonVector
Published on 2010-06-14T20:24:33Z
Indexed on
2010/06/14
20:32 UTC
Read the original article
Hit count: 176
I'm implementing an FTP-like protocol in Linux kernel 2.4 (homework), and I was under the impression that if a file is open for writing any subsequent attempt to open it by another thread should fail, until I actually tried it and discovered it goes through.
How do I prevent this from happening?
PS: I'm using open() to open the file.
© Stack Overflow or respective owner