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