Annotation of src/usr.bin/sudo/logging.h, Revision 1.3
1.1 millert 1: /*
1.2 millert 2: * Copyright (c) 1999, 2004 Todd C. Miller <Todd.Miller@courtesan.com>
1.1 millert 3: *
1.2 millert 4: * Permission to use, copy, modify, and distribute this software for any
5: * purpose with or without fee is hereby granted, provided that the above
6: * copyright notice and this permission notice appear in all copies.
7: *
8: * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9: * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10: * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11: * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12: * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13: * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14: * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1.1 millert 15: */
16:
17: #ifndef _LOGGING_H
18: #define _LOGGING_H
19:
20: #include <syslog.h>
21: #ifdef __STDC__
22: # include <stdarg.h>
23: #else
24: # include <varargs.h>
25: #endif
26:
27: /* Logging types */
28: #define SLOG_SYSLOG 0x01
29: #define SLOG_FILE 0x02
30: #define SLOG_BOTH 0x03
31:
32: /* Flags for log_error() */
33: #define MSG_ONLY 0x01
34: #define USE_ERRNO 0x02
35: #define NO_MAIL 0x04
36: #define NO_EXIT 0x08
37:
38: /*
39: * Maximum number of characters to log per entry. The syslogger
40: * will log this much, after that, it truncates the log line.
1.2 millert 41: * We need this here to make sure that we continue with another
1.1 millert 42: * syslog(3) call if the internal buffer is more than 1023 characters.
43: */
44: #ifndef MAXSYSLOGLEN
45: # define MAXSYSLOGLEN 960
46: #endif
1.2 millert 47:
1.1 millert 48: void log_auth __P((int, int));
1.3 ! millert 49: void log_error __P((int flags, const char *fmt, ...))
! 50: __printflike(2, 3);
1.1 millert 51: RETSIGTYPE reapchild __P((int));
52:
53: #endif /* _LOGGING_H */