Debian Codegraph @

upstream/debian-trixie/man3/setlogmask.3

raw
1 '\" t
2 .\" Copyright (C) 2001 Andries Brouwer <[email protected]>.
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .TH setlogmask 3 2024-05-02 "Linux man-pages 6.9.1"
7 .SH NAME
8 setlogmask \- set log priority mask
9 .SH LIBRARY
10 Standard C library
11 .RI ( libc ", " \-lc )
12 .SH SYNOPSIS
13 .nf
14 .B #include <syslog.h>
15 .P
16 .BI "int setlogmask(int " mask );
17 .fi
18 .SH DESCRIPTION
19 A process has a log priority mask that determines which calls to
20 .BR syslog (3)
21 may be logged.
22 All other calls will be ignored.
23 Logging is enabled for the priorities that have the corresponding
24 bit set in
25 .IR mask .
26 The initial mask is such that logging is enabled for all priorities.
27 .P
28 The
29 .BR setlogmask ()
30 function sets this logmask for the calling process,
31 and returns the previous mask.
32 If the
33 .I mask
34 argument is
35 .BR 0 ,
36 the current logmask is not modified.
37 .P
38 The eight priorities are
39 .BR LOG_EMERG ,
40 .BR LOG_ALERT ,
41 .BR LOG_CRIT ,
42 .BR LOG_ERR ,
43 .BR LOG_WARNING ,
44 .BR LOG_NOTICE ,
45 .BR LOG_INFO ,
46 and
47 .BR LOG_DEBUG .
48 The bit corresponding to a priority
49 .I p
50 is
51 .IR LOG_MASK(p) .
52 Some systems also provide a macro
53 .I LOG_UPTO(p)
54 for the mask
55 of all priorities in the above list up to and including
56 .IR p .
57 .SH RETURN VALUE
58 This function returns the previous log priority mask.
59 .SH ERRORS
60 None.
61 .\" .SH NOTES
62 .\" The glibc logmask handling was broken before glibc 2.1.1.
63 .SH ATTRIBUTES
64 For an explanation of the terms used in this section, see
65 .BR attributes (7).
66 .TS
67 allbox;
68 lbx lb lb
69 l l l.
70 Interface Attribute Value
71 T{
72 .na
73 .nh
74 .BR setlogmask ()
75 T} Thread safety MT-Unsafe race:LogMask
76 .TE
77 .SH STANDARDS
78 POSIX.1-2008.
79 .SH HISTORY
80 POSIX.1-2001.
81 .\" Note that the description in POSIX.1-2001 is flawed.
82 .P
83 .BR LOG_UPTO ()
84 will be included in the next release of the POSIX specification (Issue 8).
85 .\" FIXME . https://www.austingroupbugs.net/view.php?id=1033
86 .SH SEE ALSO
87 .BR closelog (3),
88 .BR openlog (3),
89 .BR syslog (3)