I am learning programming in C,
I have multiple forked process running, now I want them to read/write data from/to one file.
My question is how can I do it safely? I am not sure if the one process is writing data to the file the second process can read it while first is busy(so I get wrong data)

Thanx in advance