2 * Copyright (C) 2008 The Android Open Source Project
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in
12 * the documentation and/or other materials provided with the
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
18 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
19 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
22 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 #include <sys/cdefs.h>
48 #define LOG_PRI(x) ((x) & LOG_PRIMASK)
51 /* Facilities; not actually used */
55 #define LOG_DAEMON 0030
57 #define LOG_SYSLOG 0050
62 #define LOG_AUTHPRIV 0120
64 #define LOG_LOCAL0 0200
65 #define LOG_LOCAL1 0210
66 #define LOG_LOCAL2 0220
67 #define LOG_LOCAL3 0230
68 #define LOG_LOCAL4 0240
69 #define LOG_LOCAL5 0250
70 #define LOG_LOCAL6 0260
71 #define LOG_LOCAL7 0270
73 #define LOG_FACMASK 01770
74 #define LOG_FAC(x) (((x) >> 3) & (LOG_FACMASK >> 3))
76 #define LOG_MASK(pri) (1 << (pri)) /* mask for one priority */
77 #define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */
79 /* openlog() flags; only LOG_PID and LOG_PERROR supported */
80 #define LOG_PID 0x01 /* include pid with message */
81 #define LOG_CONS 0x02 /* write to console on logger error */
82 #define LOG_ODELAY 0x04 /* delay connection until syslog() */
83 #define LOG_NDELAY 0x08 /* open connection immediately */
84 #define LOG_NOWAIT 0x10 /* wait for child processes (unused on linux) */
85 #define LOG_PERROR 0x20 /* additional logging to stderr */
87 /* BIONIC: the following definitions are from OpenBSD's sys/syslog.h
99 #define SYSLOG_DATA_INIT {-1, 0, 0, 0, (const char *)0, LOG_USER, 0xff}
101 #define _PATH_LOG "/dev/kmsg"
103 extern void closelog(void);
104 extern void openlog(const char *, int, int);
105 extern int setlogmask(int);
106 extern void syslog(int, const char *, ...);
107 extern void vsyslog(int, const char *, va_list);
108 extern void closelog_r(struct syslog_data *);
109 extern void openlog_r(const char *, int, int, struct syslog_data *);
110 extern int setlogmask_r(int, struct syslog_data *);
111 extern void syslog_r(int, struct syslog_data *, const char *, ...);
112 extern void vsyslog_r(int, struct syslog_data *, const char *, va_list);
116 #endif /* _SYSLOG_H */