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