Import Upstream version 20180207
[hcoop/debian/mlton.git] / runtime / basis / MLton / Syslog / Syslog.c
1 #include "platform.h"
2
3 void MLton_Syslog_closelog(void) {
4 closelog();
5 }
6
7 /* openlog relies on the string being around forever. */
8 void MLton_Syslog_openlog(NullString8_t s, C_Int_t o, C_Int_t f) {
9 const char *s_ = strdup ((const char*)s);
10 if (s_ == NULL)
11 s_ = "";
12 openlog (s_, o, f);
13 }
14
15 void MLton_Syslog_syslog(C_Int_t p, NullString8_t s) {
16 syslog(p, "%s", (const char*)s);
17 }