syslog.c

00001 #include <u/libu_conf.h>
00002 #include <u/missing.h>
00003 
00004 /*
00005  * syslog(3) drop-in for Windows 
00006  */ 
00007 
00008 #if !defined(HAVE_SYSLOG)
00009 #if defined(OS_WIN)
00010 
00011 #include <windows.h>
00012 #include <io.h>
00013 #include <sys/locking.h>
00014 #include <errno.h>
00015 #include <stdio.h>
00016 #include <stdlib.h>
00017 
00018 void syslog(int priority, const char *fmt, ...)
00019 {
00020     va_list ap;
00021 
00022     va_start(ap, fmt); /* init variable list arguments */
00023 
00024     vsyslog(priority, fmt, ap);
00025 
00026     va_end(ap);
00027 }
00028 
00029 #else   /* !OS_WIN */
00030     #error "We don't have a syslog(3) implementation for this platform"
00031 #endif  /* OS_WIN */
00032 
00033 #else /* HAVE_SYSLOG */
00034 
00035 #include <syslog.h>
00036 void syslog(int priority, const char *fmt, ...);
00037 
00038 #endif  /* !HAVE_SYSLOG */

←Products
© 2005-2012 - KoanLogic S.r.l. - All rights reserved