tags:

views:

373

answers:

1

Folks, I can't find the re-entrant version of syslog() for Linux...is there one? And if no, what do you? The obvious answer is to move logging facility into separate thread and serialise access to syslog...

+5  A: 

According to the POSIX specification, the syslog function is already thread-safe, and so implemented in Linux. So syslog_r is unnecessary - use syslog if you need a reentrant logger function.

Martin v. Löwis
The BSDs define a syslog_r call, however, for an entirely different reason; individual threads may want to log with different syslog options, which is not otherwise possible.
Michiel Buddingh'
Right - that function is not available on Linux.
Martin v. Löwis