]>
Commit | Line | Data |
---|---|---|
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 |
27 | setlogmask \- 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 | |
35 | A process has a log priority mask that determines which calls to | |
36 | .BR syslog (3) | |
c13182ef MK |
37 | may be logged. |
38 | All other calls will be ignored. | |
fea681da MK |
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. | |
dd3568a1 | 43 | .PP |
fea681da | 44 | The |
63aa9df0 | 45 | .BR setlogmask () |
a1ffe9f5 | 46 | function sets this logmask for the calling process, |
fea681da MK |
47 | and returns the previous mask. |
48 | If the mask argument is 0, the current logmask is not modified. | |
dd3568a1 | 49 | .PP |
2f0af33b MK |
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 . | |
c6fa0841 MK |
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 . | |
47297adb | 69 | .SH RETURN VALUE |
c13182ef | 70 | This function returns the previous log priority mask. |
fea681da MK |
71 | .SH ERRORS |
72 | None. | |
73 | .\" .SH NOTES | |
74 | .\" The glibc logmask handling was broken in versions before glibc 2.1.1. | |
eed599dc ZL |
75 | .SH ATTRIBUTES |
76 | For an explanation of the terms used in this section, see | |
77 | .BR attributes (7). | |
78 | .TS | |
79 | allbox; | |
80 | lb lb lbw22 | |
81 | l l l. | |
82 | Interface Attribute Value | |
83 | T{ | |
84 | .BR setlogmask () | |
85 | T} Thread safety MT-Unsafe race:LogMask | |
86 | .TE | |
847e0d88 | 87 | .sp 1 |
47297adb | 88 | .SH CONFORMING TO |
c8f8fa38 | 89 | POSIX.1-2001, POSIX.1-2008. |
4e062a9f | 90 | .\" Note that the description in POSIX.1-2001 is flawed. |
47297adb | 91 | .SH SEE ALSO |
fea681da MK |
92 | .BR closelog (3), |
93 | .BR openlog (3), | |
94 | .BR syslog (3) |