Home C multiple write access to a log file (linux env)
Reply: 0

C multiple write access to a log file (linux env)

user651 Published in April 22, 2018, 6:51 am

I have a set of independent programs that I wrote in C. I would like all of them to write their log to the same file. Obviously comes the issue of control access. Two or more of them could end up writing simultaneously.

What is the most pragmatic way to achieve this?

I came across solutions using pthread/mutexes/etc but that sounds overkill implementation for something like that.

I am also looking at syslog but wonder if this is really for the purpose of what I need to do?

I feel that I need a daemon service taking the message and control when they are written. I wonder if that already exists.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.306871 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO