Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are gnu syslog(), openlog() and closelog() thread-safe?

Tags:

c

linux

gnu

syslog

I have been searching for some time and haven't found a definitive answer yet. The only link I found till now which sheds some light on this is here.

like image 392
Konoha Avatar asked Dec 18 '13 20:12

Konoha


People also ask

Is syslog thread safe?

The syslog subroutine is not threadsafe; for threadsafe programs the syslog_r subroutine should be used instead. The syslog subroutine writes messages onto the system log maintained by the syslogd command.

What is openlog in syslog?

openlog opens or reopens a connection to Syslog in preparation for submitting messages. ident is an arbitrary identification string which future syslog invocations will prefix to each message.


1 Answers

According to the POSIX Specification syslog(), openlog() and closelog() are thread safe.

There's another thread that answers this question as well and it is dated as far back as 2009. Here's the link syslog_r for Linux?.

like image 132
alvits Avatar answered Sep 28 '22 19:09

alvits