/*
- * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#define _SYS_SYSLOG_H_
#include <sys/appleapiopts.h>
+#include <sys/cdefs.h>
#define _PATH_LOG "/var/run/syslog"
} CODE;
CODE prioritynames[] = {
- "alert", LOG_ALERT,
- "crit", LOG_CRIT,
- "debug", LOG_DEBUG,
- "emerg", LOG_EMERG,
- "err", LOG_ERR,
- "error", LOG_ERR, /* DEPRECATED */
- "info", LOG_INFO,
- "none", INTERNAL_NOPRI, /* INTERNAL */
- "notice", LOG_NOTICE,
- "panic", LOG_EMERG, /* DEPRECATED */
- "warn", LOG_WARNING, /* DEPRECATED */
- "warning", LOG_WARNING,
- NULL, -1,
+ { "alert", LOG_ALERT },
+ { "crit", LOG_CRIT },
+ { "debug", LOG_DEBUG },
+ { "emerg", LOG_EMERG },
+ { "err", LOG_ERR },
+ { "error", LOG_ERR }, /* DEPRECATED */
+ { "info", LOG_INFO },
+ { "none", INTERNAL_NOPRI }, /* INTERNAL */
+ { "notice", LOG_NOTICE },
+ { "panic", LOG_EMERG }, /* DEPRECATED */
+ { "warn", LOG_WARNING }, /* DEPRECATED */
+ { "warning", LOG_WARNING },
+ { 0, -1 }
};
#endif
/* facility codes */
-#define LOG_KERN (0<<3) /* kernel messages */
-#define LOG_USER (1<<3) /* random user-level messages */
-#define LOG_MAIL (2<<3) /* mail system */
-#define LOG_DAEMON (3<<3) /* system daemons */
-#define LOG_AUTH (4<<3) /* security/authorization messages */
-#define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */
-#define LOG_LPR (6<<3) /* line printer subsystem */
-#define LOG_NEWS (7<<3) /* network news subsystem */
-#define LOG_UUCP (8<<3) /* UUCP subsystem */
-#define LOG_CRON (9<<3) /* clock daemon */
-#define LOG_AUTHPRIV (10<<3) /* security/authorization messages (private) */
-#define LOG_FTP (11<<3) /* ftp daemon */
-#define LOG_NETINFO (12<<3) /* NetInfo */
+#define LOG_KERN (0<<3) /* kernel messages */
+#define LOG_USER (1<<3) /* random user-level messages */
+#define LOG_MAIL (2<<3) /* mail system */
+#define LOG_DAEMON (3<<3) /* system daemons */
+#define LOG_AUTH (4<<3) /* security/authorization messages */
+#define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */
+#define LOG_LPR (6<<3) /* line printer subsystem */
+#define LOG_NEWS (7<<3) /* network news subsystem */
+#define LOG_UUCP (8<<3) /* UUCP subsystem */
+#define LOG_CRON (9<<3) /* clock daemon */
+#define LOG_AUTHPRIV (10<<3) /* security/authorization messages (private) */
+#define LOG_FTP (11<<3) /* ftp daemon */
+#define LOG_NETINFO (12<<3) /* NetInfo */
#define LOG_REMOTEAUTH (13<<3) /* remote authentication/authorization */
-#define LOG_INSTALL (14<<3) /* installer subsystem */
+#define LOG_INSTALL (14<<3) /* installer subsystem */
+#define LOG_RAS (15<<3) /* Remote Access Service (VPN / PPP) */
- /* other codes through 15 reserved for system use */
#define LOG_LOCAL0 (16<<3) /* reserved for local use */
#define LOG_LOCAL1 (17<<3) /* reserved for local use */
#define LOG_LOCAL2 (18<<3) /* reserved for local use */
#define LOG_LOCAL6 (22<<3) /* reserved for local use */
#define LOG_LOCAL7 (23<<3) /* reserved for local use */
-#define LOG_NFACILITIES 24 /* current number of facilities */
+#define LOG_LAUNCHD (24<<3) /* launchd - general bootstrap daemon */
+
+#define LOG_NFACILITIES 25 /* current number of facilities */
#define LOG_FACMASK 0x03f8 /* mask to extract facility part */
/* facility of pri */
#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3)
#ifdef SYSLOG_NAMES
CODE facilitynames[] = {
- "auth", LOG_AUTH,
- "authpriv", LOG_AUTHPRIV,
- "cron", LOG_CRON,
- "daemon", LOG_DAEMON,
- "ftp", LOG_FTP,
- "install", LOG_INSTALL,
- "kern", LOG_KERN,
- "lpr", LOG_LPR,
- "mail", LOG_MAIL,
- "mark", INTERNAL_MARK, /* INTERNAL */
- "netinfo", LOG_NETINFO,
- "remoteauth", LOG_REMOTEAUTH,
- "news", LOG_NEWS,
- "security", LOG_AUTH, /* DEPRECATED */
- "syslog", LOG_SYSLOG,
- "user", LOG_USER,
- "uucp", LOG_UUCP,
- "local0", LOG_LOCAL0,
- "local1", LOG_LOCAL1,
- "local2", LOG_LOCAL2,
- "local3", LOG_LOCAL3,
- "local4", LOG_LOCAL4,
- "local5", LOG_LOCAL5,
- "local6", LOG_LOCAL6,
- "local7", LOG_LOCAL7,
- NULL, -1,
+ { "auth", LOG_AUTH },
+ { "authpriv", LOG_AUTHPRIV },
+ { "cron", LOG_CRON },
+ { "daemon", LOG_DAEMON },
+ { "ftp", LOG_FTP },
+ { "install", LOG_INSTALL },
+ { "kern", LOG_KERN },
+ { "lpr", LOG_LPR },
+ { "mail", LOG_MAIL },
+ { "mark", INTERNAL_MARK }, /* INTERNAL */
+ { "netinfo", LOG_NETINFO },
+ { "ras", LOG_RAS },
+ { "remoteauth", LOG_REMOTEAUTH },
+ { "news", LOG_NEWS },
+ { "security", LOG_AUTH }, /* DEPRECATED */
+ { "syslog", LOG_SYSLOG },
+ { "user", LOG_USER },
+ { "uucp", LOG_UUCP },
+ { "local0", LOG_LOCAL0 },
+ { "local1", LOG_LOCAL1 },
+ { "local2", LOG_LOCAL2 },
+ { "local3", LOG_LOCAL3 },
+ { "local4", LOG_LOCAL4 },
+ { "local5", LOG_LOCAL5 },
+ { "local6", LOG_LOCAL6 },
+ { "local7", LOG_LOCAL7 },
+ { "launchd", LOG_LAUNCHD },
+ { 0, -1 }
};
#endif
#define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */
#define LOG_PERROR 0x20 /* log to stderr as well */
-#include <sys/cdefs.h>
-
#ifndef KERNEL
-
-/*
- * Don't use va_list in the vsyslog() prototype. Va_list is typedef'd in two
- * places (<machine/varargs.h> and <machine/stdarg.h>), so if we include one
- * of them here we may collide with the utility's includes. It's unreasonable
- * for utilities to have to include one of them to include syslog.h, so we get
- * _BSD_VA_LIST_ from <machine/ansi.h> and use it.
- */
-#include <machine/ansi.h>
+#ifndef _POSIX_C_SOURCE
+#include <sys/_types.h> /* for __darwin_va_list */
+#endif /* _POSIX_C_SOURCE */
__BEGIN_DECLS
-void closelog __P((void));
-void openlog __P((const char *, int, int));
-int setlogmask __P((int));
-void syslog __P((int, const char *, ...));
-void vsyslog __P((int, const char *, _BSD_VA_LIST_));
+void closelog(void);
+void openlog(const char *, int, int);
+int setlogmask(int);
+void syslog(int, const char *, ...) __DARWIN_LDBL_COMPAT(syslog);
+#ifndef _POSIX_C_SOURCE
+void vsyslog(int, const char *, __darwin_va_list) __DARWIN_LDBL_COMPAT(vsyslog);
+#endif /* _POSIX_C_SOURCE */
__END_DECLS
#else /* !KERNEL */
#endif /* __APPLE_API_OBSOLETE */
-void logpri __P((int));
-void log __P((int, const char *, ...));
-void addlog __P((const char *, ...));
+__BEGIN_DECLS
+void logpri(int);
+void log(int, const char *, ...);
+void addlog(const char *, ...);
+__END_DECLS
#endif /* !KERNEL */
#endif /* !_SYS_SYSLOG_H_ */