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