13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22 /*
23 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
28 /* All Rights Reserved */
29
30 #ifndef _SYS_LOG_H
31 #define _SYS_LOG_H
32
33 #pragma ident "%Z%%M% %I% %E% SMI"
34
35 #include <sys/types.h>
36 #include <sys/strlog.h>
37 #include <sys/stream.h>
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43 #define LOG_CONSMIN 0 /* /dev/conslog minor */
44 #define LOG_LOGMIN 5 /* /dev/log minor */
45 #define LOG_BACKLOG LOG_LOGMIN /* console backlog queue */
46
47 #define LOG_LOGMINIDX 0 /* index of smallest /dev/log clone */
48 #define LOG_LOGMAXIDX 15 /* up to 16 /dev/log clones */
49 #define LOG_NUMCLONES (LOG_LOGMAXIDX - LOG_LOGMINIDX + 1)
50
51 #define LOG_MID 44 /* module ID */
52 #define LOG_MINPS 0 /* min packet size */
53 #define LOG_MAXPS 1024 /* max packet size */
54 #define LOG_LOWAT 2048 /* threshold for backenable */
55 #define LOG_HIWAT 1048576 /* threshold for tossing messages */
56
57 #define LOG_MAGIC 0xf00d4109U /* "food for log" - unsent msg magic */
58 #define LOG_RECENTSIZE 8192 /* queue of most recent messages */
59 #define LOG_MINFREE 4096 /* message cache low water mark */
60 #define LOG_MAXFREE 8192 /* message cache high water mark */
61
62 typedef struct log log_t;
63 typedef int (log_filter_t)(log_t *, log_ctl_t *);
64
65 struct log {
66 queue_t *log_q; /* message queue */
67 log_filter_t *log_wanted; /* message filter */
68 mblk_t *log_data; /* parameters for filter */
69 uint16_t log_flags; /* message type (e.g. SL_CONSOLE) */
70 short log_inuse; /* is this log device open? */
71 int log_overflow; /* messages lost due to QFULL */
72 zoneid_t log_zoneid; /* zone id of log */
73 major_t log_major; /* device type */
74 minor_t log_minor; /* minor number of associated device */
75 };
76
77 /* Array of /dev/log minor devices */
78 typedef struct log_zone {
|
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22 /*
23 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
28 /* All Rights Reserved */
29
30 #ifndef _SYS_LOG_H
31 #define _SYS_LOG_H
32
33 #include <sys/types.h>
34 #include <sys/strlog.h>
35 #include <sys/stream.h>
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40
41 #define LOG_CONSMIN 0 /* /dev/conslog minor */
42 #define LOG_LOGMIN 5 /* /dev/log minor */
43 #define LOG_BACKLOG LOG_LOGMIN /* console backlog queue */
44
45 #define LOG_LOGMINIDX 0 /* index of smallest /dev/log clone */
46 #define LOG_LOGMAXIDX 15 /* up to 16 /dev/log clones */
47 #define LOG_NUMCLONES (LOG_LOGMAXIDX - LOG_LOGMINIDX + 1)
48
49 #define LOG_MID 44 /* module ID */
50 #define LOG_MINPS 0 /* min packet size */
51 #define LOG_MAXPS 1024 /* max packet size */
52 #define LOG_LOWAT 2048 /* threshold for backenable */
53 #define LOG_HIWAT 1048576 /* threshold for tossing messages */
54
55 #define LOG_MAGIC 0xf00d4109U /* "food for log" - unsent msg magic */
56 #define LOG_RECENTSIZE 65536 /* queue of most recent messages */
57 #define LOG_MINFREE 4096 /* message cache low water mark */
58 #define LOG_MAXFREE 8192 /* message cache high water mark */
59
60 typedef struct log log_t;
61 typedef int (log_filter_t)(log_t *, log_ctl_t *);
62
63 struct log {
64 queue_t *log_q; /* message queue */
65 log_filter_t *log_wanted; /* message filter */
66 mblk_t *log_data; /* parameters for filter */
67 uint16_t log_flags; /* message type (e.g. SL_CONSOLE) */
68 short log_inuse; /* is this log device open? */
69 int log_overflow; /* messages lost due to QFULL */
70 zoneid_t log_zoneid; /* zone id of log */
71 major_t log_major; /* device type */
72 minor_t log_minor; /* minor number of associated device */
73 };
74
75 /* Array of /dev/log minor devices */
76 typedef struct log_zone {
|