X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/55e303ae13a4cf49d70f2294092726f2fffb9ef2..36401178fd6817c043cc00b0c00c7f723e58efae:/bsd/sys/syslog.h diff --git a/bsd/sys/syslog.h b/bsd/sys/syslog.h index 0a1901d1d..a681d394f 100644 --- a/bsd/sys/syslog.h +++ b/bsd/sys/syslog.h @@ -1,16 +1,19 @@ /* - * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. * - * @APPLE_LICENSE_HEADER_START@ - * - * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this - * file. + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER @@ -20,7 +23,7 @@ * Please see the License for the specific language governing rights and * limitations under the License. * - * @APPLE_LICENSE_HEADER_END@ + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ /* @@ -62,6 +65,7 @@ #define _SYS_SYSLOG_H_ #include +#include #define _PATH_LOG "/var/run/syslog" @@ -98,40 +102,40 @@ typedef struct _code { } 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 */ @@ -141,39 +145,43 @@ CODE prioritynames[] = { #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 @@ -202,25 +210,19 @@ CODE facilitynames[] = { #define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */ #define LOG_PERROR 0x20 /* log to stderr as well */ -#include - #ifndef KERNEL - -/* - * Don't use va_list in the vsyslog() prototype. Va_list is typedef'd in two - * places ( and ), 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 and use it. - */ -#include +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#include /* for __darwin_va_list */ +#endif /* (_POSIX_C_SOURCE && !_DARWIN_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); +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +void vsyslog(int, const char *, __darwin_va_list) __DARWIN_LDBL_COMPAT(vsyslog); +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ __END_DECLS #else /* !KERNEL */ @@ -306,9 +308,13 @@ struct reg_desc { #endif /* __APPLE_API_OBSOLETE */ -void logpri __P((int)); -void log __P((int, const char *, ...)); -void addlog __P((const char *, ...)); +#include +__BEGIN_DECLS +void logpri(int); +void log(int, const char *, ...); +int vaddlog(const char *, va_list); +void logtime(time_t); +__END_DECLS #endif /* !KERNEL */ #endif /* !_SYS_SYSLOG_H_ */