]>
git.saurik.com Git - apple/xnu.git/blob - osfmk/sys/syslog.h
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
36 * Revision 1.1.1.1 1998/09/22 21:05:48 wsanchez
37 * Import of Mac OS X kernel (~semeria)
39 * Revision 1.1.1.1 1998/03/07 02:25:59 wsanchez
40 * Import of OSF Mach kernel (~mburg)
42 * Revision 1.2.6.1 1994/09/23 03:13:08 ezf
43 * change marker to not FREE
44 * [1994/09/22 21:58:52 ezf]
46 * Revision 1.2.2.3 1993/08/03 18:30:38 gm
47 * CR9596: Change KERNEL to MACH_KERNEL.
48 * [1993/08/02 19:02:56 gm]
50 * Revision 1.2.2.2 1993/06/09 02:55:27 gm
51 * Added to OSF/1 R1.3 from NMK15.0.
52 * [1993/06/02 21:30:57 jeffc]
54 * Revision 1.2 1993/04/19 17:16:58 devrcs
56 * [1993/02/26 14:02:39 sp]
58 * Revision 1.1 1992/09/30 02:36:56 robert
65 * Revision 2.4 91/05/14 17:40:18 mrt
66 * Correcting copyright
68 * Revision 2.3 91/05/13 06:07:15 af
69 * Removed CMU conditionals.
70 * [91/05/12 16:31:12 af]
72 * Revision 2.2 91/02/05 17:56:53 mrt
73 * Changed to new Mach copyright
74 * [91/02/01 17:49:22 mrt]
76 * Revision 2.1 89/08/03 16:10:10 rwd
82 * Mach Operating System
83 * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
84 * All Rights Reserved.
86 * Permission to use, copy, modify and distribute this software and its
87 * documentation is hereby granted, provided that both the copyright
88 * notice and this permission notice appear in all copies of the
89 * software, derivative works or modified versions, and any portions
90 * thereof, and that both notices appear in supporting documentation.
92 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
93 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
94 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
96 * Carnegie Mellon requests users of this software to return to
98 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
99 * School of Computer Science
100 * Carnegie Mellon University
101 * Pittsburgh PA 15213-3890
103 * any improvements or extensions that they make and grant Carnegie Mellon rights
104 * to redistribute these changes.
110 * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
111 * All rights reserved.
113 * Redistribution and use in source and binary forms are permitted
114 * provided that the above copyright notice and this paragraph are
115 * duplicated in all such forms and that any documentation,
116 * advertising materials, and other materials related to such
117 * distribution and use acknowledge that the software was developed
118 * by the University of California, Berkeley. The name of the
119 * University may not be used to endorse or promote products derived
120 * from this software without specific prior written permission.
121 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
122 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
123 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
125 * @(#)syslog.h 7.10 (Berkeley) 6/27/88
132 #ifndef _SYS_SYSLOG_H_
133 #define _SYS_SYSLOG_H_
135 #define LOG_KERN (0<<3) /* kernel messages */
136 #define LOG_USER (1<<3) /* random user-level messages */
137 #define LOG_MAIL (2<<3) /* mail system */
138 #define LOG_DAEMON (3<<3) /* system daemons */
139 #define LOG_AUTH (4<<3) /* security/authorization messages */
140 #define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */
141 #define LOG_LPR (6<<3) /* line printer subsystem */
142 #define LOG_NEWS (7<<3) /* network news subsystem */
143 #define LOG_UUCP (8<<3) /* UUCP subsystem */
144 /* other codes through 15 reserved for system use */
145 #define LOG_LOCAL0 (16<<3) /* reserved for local use */
146 #define LOG_LOCAL1 (17<<3) /* reserved for local use */
147 #define LOG_LOCAL2 (18<<3) /* reserved for local use */
148 #define LOG_LOCAL3 (19<<3) /* reserved for local use */
149 #define LOG_LOCAL4 (20<<3) /* reserved for local use */
150 #define LOG_LOCAL5 (21<<3) /* reserved for local use */
151 #define LOG_LOCAL6 (22<<3) /* reserved for local use */
152 #define LOG_LOCAL7 (23<<3) /* reserved for local use */
154 #define LOG_NFACILITIES 24 /* maximum number of facilities */
155 #define LOG_FACMASK 0x03f8 /* mask to extract facility part */
157 #define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3) /* facility of pri */
160 * Priorities (these are ordered)
163 #define LOG_EMERG 0 /* system is unusable */
164 #define LOG_ALERT 1 /* action must be taken immediately */
165 #define LOG_CRIT 2 /* critical conditions */
166 #define LOG_ERR 3 /* error conditions */
167 #define LOG_WARNING 4 /* warning conditions */
168 #define LOG_NOTICE 5 /* normal but signification condition */
169 #define LOG_INFO 6 /* informational */
170 #define LOG_DEBUG 7 /* debug-level messages */
172 #define LOG_PRIMASK 0x0007 /* mask to extract priority part (internal) */
173 #define LOG_PRI(p) ((p) & LOG_PRIMASK) /* extract priority */
175 #define LOG_MAKEPRI(fac, pri) (((fac) << 3) | (pri))
178 #define LOG_PRINTF -1 /* pseudo-priority to indicate use of printf */
182 * arguments to setlogmask.
184 #define LOG_MASK(pri) (1 << (pri)) /* mask for one priority */
185 #define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */
188 * Option flags for openlog.
190 * LOG_ODELAY no longer does anything; LOG_NDELAY is the
191 * inverse of what it used to be.
193 #define LOG_PID 0x01 /* log the pid with each message */
194 #define LOG_CONS 0x02 /* log on the console if errors in sending */
195 #define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */
196 #define LOG_NDELAY 0x08 /* don't delay open */
197 #define LOG_NOWAIT 0x10 /* if forking to log on console, don't wait() */
199 #if defined(__STDC__)
200 extern void openlog(const char *, int);
201 extern void syslog(int, const char *, ...);
202 extern void closelog(void);
203 extern void setlogmask(int);
204 #endif /* defined(__STDC__) */
205 #endif /* _SYS_SYSLOG_H_ */