OSDN Git Service

47344911993c6ff8ba379fa3a9454c1a77cc7a16
[linuxjm/LDP_man-pages.git] / original / man3 / setlogmask.3
1 .\" Copyright (C) 2001 Andries Brouwer <aeb@cwi.nl>.
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .TH SETLOGMASK 3  2001-10-05 "" "Linux Programmer's Manual"
26 .SH NAME
27 setlogmask \- set log priority mask
28 .SH SYNOPSIS
29 .nf
30 .B #include <syslog.h>
31 .sp
32 .BI "int setlogmask(int " mask );
33 .fi
34 .SH DESCRIPTION
35 A process has a log priority mask that determines which calls to
36 .BR syslog (3)
37 may be logged.
38 All other calls will be ignored.
39 Logging is enabled for the priorities that have the corresponding
40 bit set in
41 .IR mask .
42 The initial mask is such that logging is enabled for all priorities.
43 .LP
44 The
45 .BR setlogmask ()
46 function sets this logmask for the calling process,
47 and returns the previous mask.
48 If the mask argument is 0, the current logmask is not modified.
49 .LP
50 The eight priorities are
51 .BR LOG_EMERG ,
52 .BR LOG_ALERT ,
53 .BR LOG_CRIT ,
54 .BR LOG_ERR ,
55 .BR LOG_WARNING ,
56 .BR LOG_NOTICE ,
57 .BR LOG_INFO ,
58 and
59 .BR LOG_DEBUG .
60 The bit corresponding to a priority
61 .I p
62 is
63 .IR LOG_MASK(p) .
64 Some systems also provide a macro
65 .IR LOG_UPTO(p)
66 for the mask
67 of all priorities in the above list up to and including
68 .IR p .
69 .SH RETURN VALUE
70 This function returns the previous log priority mask.
71 .SH ERRORS
72 None.
73 .\" .SH NOTES
74 .\" The glibc logmask handling was broken in versions before glibc 2.1.1.
75 .SH CONFORMING TO
76 POSIX.1-2001.
77 Note that the description in POSIX.1-2001 is flawed.
78 .SH SEE ALSO
79 .BR closelog (3),
80 .BR openlog (3),
81 .BR syslog (3)
82 .SH COLOPHON
83 This page is part of release 3.64 of the Linux
84 .I man-pages
85 project.
86 A description of the project,
87 and information about reporting bugs,
88 can be found at
89 \%http://www.kernel.org/doc/man\-pages/.