2 * Acess2 POSIX Emulation
3 * - By John Hodge (thePowersGang)
9 #include <stdio.h> // vsnprintf
10 #include <stdlib.h> // free
11 #include <string.h> // strdup
13 #include <acess/sys.h>
16 char *gsSyslogPrefix = NULL;
23 * Close global logging handle
29 void openlog(const char *name, int option, int facility)
33 gsSyslogPrefix = strdup(name);
34 gSyslogOptions = option;
35 gSyslogFacility = facility;
37 if( option & LOG_NOWAIT )
39 // Open the logging handle!
43 extern int setlogmask(int mask)
45 int ret = gSyslogMask;
50 extern void syslog(int priority, const char *str, ...)
55 vsnprintf(staticbuf, sizeof(staticbuf), str, args);
57 if( gSyslogOptions & (1 << priority) )
59 // TODO: Proper syslog
60 _SysDebug("syslog(%i: %s) - %s", priority, gsSyslogPrefix, staticbuf);