OSDN Git Service

4a412e4e22733f9684023e4294e3df2d10431aea
[linuxjm/LDP_man-pages.git] / draft / man3 / setlogmask.3
1 .\" Copyright (C) 2001 Andries Brouwer <aeb@cwi.nl>.
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" Japanese Version Copyright (c) 2001 Akihiro MOTOKI
24 .\"         all rights reserved.
25 .\" Translated Sat Nov  3 01:46:03 JST 2001
26 .\"         by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
27 .\"
28 .\"WORD:        logging         ¥í¥°¼ý½¸
29 .\"
30 .TH SETLOGMASK 3  2001-10-05 "" "Linux Programmer's Manual"
31 .\"O .SH NAME
32 .SH Ì¾Á°
33 .\"O setlogmask \- set log priority mask
34 setlogmask \- ¥í¥°¤ÎÍ¥ÀèÅÙ¥Þ¥¹¥¯¤òÀßÄꤹ¤ë
35 .\"O .SH SYNOPSIS
36 .SH ½ñ¼°
37 .nf
38 .B #include <syslog.h>
39 .sp
40 .BI "int setlogmask(int " mask );
41 .fi
42 .\"O .SH DESCRIPTION
43 .SH ÀâÌÀ
44 .\"O A process has a log priority mask that determines which calls to
45 .\"O .BR syslog (3)
46 .\"O may be logged.
47 .\"O All other calls will be ignored.
48 ¥×¥í¥»¥¹¤Ë¤Ï¥í¥°Í¥ÀèÅÙ¥Þ¥¹¥¯(log priority mask)¤¬ÍÑ°Õ¤µ¤ì¤Æ¤¤¤Æ¡¢
49 ¤³¤ì¤òÍѤ¤¤Æ
50 .BR syslog (3)
51 ¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¤Ë¥í¥°µ­Ï¿¤ò¹Ô¤¦¤«¤É¤¦¤«¤ò·èÄꤹ¤ë¡£
52 ¾¤Î¤¹¤Ù¤Æ¤Î´Ø¿ô¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¤Ï¥í¥°µ­Ï¿¤¬¹Ô¤ï¤ì¤Ê¤¤¡£
53 .\"O Logging is enabled for the priorities that have the corresponding
54 .\"O bit set in
55 .\"O .IR mask .
56 .I mask
57 ¤Î³Æ¥Ó¥Ã¥È¤ÏÍ¥ÀèÅÙ¤ËÂбþ¤·¤Æ¤ª¤ê¡¢Âбþ¤¹¤ë¥Ó¥Ã¥È¤¬ 1 ¤Ë¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë
58 Í¥ÀèÅÙ¤ËÂФ·¤Æ¥í¥°¼ý½¸(logging)¤¬Í­¸ú¤Ë¤Ê¤ë¡£
59 .\"O The initial mask is such that logging is enabled for all priorities.
60 ¥Þ¥¹¥¯¤Î½é´üÃͤϡ¢¤¹¤Ù¤Æ¤ÎÍ¥ÀèÅÙ¤ËÂФ·¤Æ¥í¥°¼ý½¸¤¬Í­¸ú¤Ë¤Ê¤ë¤è¤¦¤ÊÃͤǤ¢¤ë¡£
61 .LP
62 .\"O The
63 .\"O .BR setlogmask ()
64 .\"O function sets this logmask for the calling process,
65 .\"O and returns the previous mask.
66 .BR setlogmask ()
67 ´Ø¿ô¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ËÂФ¹¤ë¥í¥°¥Þ¥¹¥¯¤òÀßÄꤷ¡¢
68 Êѹ¹Á°¤Î¥Þ¥¹¥¯¤òÊÖ¤¹¡£
69 .\"O If the mask argument is 0, the current logmask is not modified.
70 .I mask
71 °ú¤­¿ô¤¬ 0 ¤Ê¤é¤Ð¡¢¸½ºß¤Î¥í¥°¥Þ¥¹¥¯¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£
72 .LP
73 .\"O The eight priorities are
74 .\"O .BR LOG_EMERG ,
75 .\"O .BR LOG_ALERT ,
76 .\"O .BR LOG_CRIT ,
77 .\"O .BR LOG_ERR ,
78 .\"O .BR LOG_WARNING ,
79 .\"O .BR LOG_NOTICE ,
80 .\"O .BR LOG_INFO ,
81 .\"O and
82 .\"O .BR LOG_DEBUG .
83 .\"O The bit corresponding to a priority \fIp\fP is \fBLOG_MASK\fP(\fIp\fP).
84 .\"O Some systems also provide a macro \fBLOG_UPTO\fP(\fIp\fP) for the mask
85 .\"O of all priorities in the above list up to and including \fIp\fP.
86 °Ê²¼¤Î8¥ì¥Ù¥ë¤ÎÍ¥ÀèÅÙ¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë(Í¥ÀèÅ٤ι⤤½ç)¡§
87 .BR LOG_EMERG ,
88 .BR LOG_ALERT ,
89 .BR LOG_CRIT ,
90 .BR LOG_ERR ,
91 .BR LOG_WARNING ,
92 .BR LOG_NOTICE ,
93 .BR LOG_INFO ,
94 .BR LOG_DEBUG ¡£
95 Í¥ÀèÅÙ \fIp\fP ¤ËÂбþ¤¹¤ë¥Ó¥Ã¥ÈÎó¤Ï \fBLOG_MASK\fP(\fIp\fP) ¤Ë¤è¤Ã¤Æµá¤á¤é¤ì¤ë¡£
96 Í¥ÀèÅÙ \fIp\fP °Ê¾å¤Î¤¹¤Ù¤Æ¤ÎÍ¥ÀèÅÙ (\fIp\fP ¤ò´Þ¤à) ¤Î¥Þ¥¹¥¯¥Ó¥Ã¥È¤ò
97 µá¤á¤ë¤³¤È¤¬¤Ç¤­¤ë¥Þ¥¯¥í \fBLOG_UPTO\fP(\fIp\fP) ¤ò»ÈÍѤǤ­¤ë¥·¥¹¥Æ¥à¤â¤¢¤ë¡£
98 .\"O .SH "RETURN VALUE"
99 .SH ÊÖ¤êÃÍ
100 .\"O This function returns the previous log priority mask.
101 Êѹ¹Á°¤Î¥í¥°Í¥ÀèÅÙ¥Þ¥¹¥¯¤ÎÃͤòÊÖ¤¹¡£
102 .\"O .SH ERRORS
103 .SH ¥¨¥é¡¼
104 .\"O None.
105 ¤Ê¤·¡£
106 .\"O .\" .SH NOTES
107 .SH Ãí°Õ
108 .\"O .\" The glibc logmask handling was broken in versions before glibc 2.1.1.
109 glibc 2.1.1 ¤è¤êÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï glibc ¤Î¥í¥°¥Þ¥¹¥¯¤Î°·¤¤¤ËÉÔ¶ñ¹ç¤¬¤¢¤ë¡£
110 .\"O .SH "CONFORMING TO"
111 .SH ½àµò
112 POSIX.1-2001.
113 .\"O Note that the description in POSIX.1-2001 is flawed.
114 POSIX.1-2001 ¤Ç¤ÎÀâÌÀ¤Ë¤Ï·ç´Ù¤¬¤¢¤ë¤³¤È¤ËÃí°Õ¤¹¤ë¤³¤È¡£
115 .\"O .SH "SEE ALSO"
116 .SH ´ØÏ¢¹àÌÜ
117 .BR closelog (3),
118 .BR openlog (3),
119 .BR syslog (3)