]>
Commit | Line | Data |
---|---|---|
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 |
7 | setlogmask \- set log priority mask | |
0cc8a315 AC |
8 | .SH LIBRARY |
9 | Standard 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 | |
18 | A process has a log priority mask that determines which calls to | |
19 | .BR syslog (3) | |
c13182ef MK |
20 | may be logged. |
21 | All other calls will be ignored. | |
fea681da MK |
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. | |
dd3568a1 | 26 | .PP |
fea681da | 27 | The |
63aa9df0 | 28 | .BR setlogmask () |
a1ffe9f5 | 29 | function sets this logmask for the calling process, |
fea681da MK |
30 | and returns the previous mask. |
31 | If the mask argument is 0, the current logmask is not modified. | |
dd3568a1 | 32 | .PP |
2f0af33b MK |
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 . | |
c6fa0841 MK |
43 | The bit corresponding to a priority |
44 | .I p | |
45 | is | |
46 | .IR LOG_MASK(p) . | |
47 | Some systems also provide a macro | |
1ae6b2c7 | 48 | .I LOG_UPTO(p) |
c6fa0841 MK |
49 | for the mask |
50 | of all priorities in the above list up to and including | |
51 | .IR p . | |
47297adb | 52 | .SH RETURN VALUE |
c13182ef | 53 | This function returns the previous log priority mask. |
fea681da MK |
54 | .SH ERRORS |
55 | None. | |
56 | .\" .SH NOTES | |
57 | .\" The glibc logmask handling was broken in versions before glibc 2.1.1. | |
eed599dc ZL |
58 | .SH ATTRIBUTES |
59 | For 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 |
64 | allbox; | |
c466875e | 65 | lbx lb lb |
eed599dc ZL |
66 | l l l. |
67 | Interface Attribute Value | |
68 | T{ | |
69 | .BR setlogmask () | |
70 | T} Thread safety MT-Unsafe race:LogMask | |
71 | .TE | |
c466875e MK |
72 | .hy |
73 | .ad | |
847e0d88 | 74 | .sp 1 |
3113c7f3 | 75 | .SH STANDARDS |
c8f8fa38 | 76 | POSIX.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 () | |
80 | will 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) |