]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/setlogmask.3
rename.2: SEE ALSO: add rename(1)
[thirdparty/man-pages.git] / man3 / setlogmask.3
CommitLineData
fea681da
MK
1.\" Copyright (C) 2001 Andries Brouwer <aeb@cwi.nl>.
2.\"
93015253 3.\" %%%LICENSE_START(VERBATIM)
fea681da
MK
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.
c13182ef 12.\"
fea681da
MK
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.
c13182ef 20.\"
fea681da
MK
21.\" Formatted or processed versions of this manual, if unaccompanied by
22.\" the source, must acknowledge the copyright and authors of this work.
4b72fb64 23.\" %%%LICENSE_END
fea681da 24.\"
4b8c67d9 25.TH SETLOGMASK 3 2017-09-15 "" "Linux Programmer's Manual"
fea681da
MK
26.SH NAME
27setlogmask \- set log priority mask
28.SH SYNOPSIS
29.nf
30.B #include <syslog.h>
68e4db0a 31.PP
fea681da
MK
32.BI "int setlogmask(int " mask );
33.fi
34.SH DESCRIPTION
35A process has a log priority mask that determines which calls to
36.BR syslog (3)
c13182ef
MK
37may be logged.
38All other calls will be ignored.
fea681da
MK
39Logging is enabled for the priorities that have the corresponding
40bit set in
41.IR mask .
42The initial mask is such that logging is enabled for all priorities.
dd3568a1 43.PP
fea681da 44The
63aa9df0 45.BR setlogmask ()
a1ffe9f5 46function sets this logmask for the calling process,
fea681da
MK
47and returns the previous mask.
48If the mask argument is 0, the current logmask is not modified.
dd3568a1 49.PP
2f0af33b
MK
50The 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 ,
58and
59.BR LOG_DEBUG .
c6fa0841
MK
60The bit corresponding to a priority
61.I p
62is
63.IR LOG_MASK(p) .
64Some systems also provide a macro
65.IR LOG_UPTO(p)
66for the mask
67of all priorities in the above list up to and including
68.IR p .
47297adb 69.SH RETURN VALUE
c13182ef 70This function returns the previous log priority mask.
fea681da
MK
71.SH ERRORS
72None.
73.\" .SH NOTES
74.\" The glibc logmask handling was broken in versions before glibc 2.1.1.
eed599dc
ZL
75.SH ATTRIBUTES
76For an explanation of the terms used in this section, see
77.BR attributes (7).
78.TS
79allbox;
80lb lb lbw22
81l l l.
82Interface Attribute Value
83T{
84.BR setlogmask ()
85T} Thread safety MT-Unsafe race:LogMask
86.TE
847e0d88 87.sp 1
47297adb 88.SH CONFORMING TO
c8f8fa38 89POSIX.1-2001, POSIX.1-2008.
4e062a9f 90.\" Note that the description in POSIX.1-2001 is flawed.
e9378590
MK
91.PP
92.BR LOG_UPTO ()
93will be included in the next release of the POSIX specification (Issue 8).
94.\" FIXME . https://www.austingroupbugs.net/view.php?id=1033
47297adb 95.SH SEE ALSO
fea681da
MK
96.BR closelog (3),
97.BR openlog (3),
98.BR syslog (3)