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