1SETLOGMASK(3) Linux Programmer's Manual SETLOGMASK(3)
2
3
4
6 setlogmask - set log priority mask
7
9 #include <syslog.h>
10
11 int setlogmask(int mask);
12
14 A process has a log priority mask that determines which calls to sys‐
15 log(3) may be logged. All other calls will be ignored. Logging is
16 enabled for the priorities that have the corresponding bit set in mask.
17 The initial mask is such that logging is enabled for all priorities.
18
19 The setlogmask() function sets this logmask for the calling process,
20 and returns the previous mask. If the mask argument is 0, the current
21 logmask is not modified.
22
23 The eight priorities are LOG_EMERG, LOG_ALERT, LOG_CRIT, LOG_ERR,
24 LOG_WARNING, LOG_NOTICE, LOG_INFO, and LOG_DEBUG. The bit correspond‐
25 ing to a priority p is LOG_MASK(p). Some systems also provide a macro
26 LOG_UPTO(p) for the mask of all priorities in the above list up to and
27 including p.
28
30 This function returns the previous log priority mask.
31
33 None.
34
36 For an explanation of the terms used in this section, see
37 attributes(7).
38
39 ┌─────────────┬───────────────┬────────────────────────┐
40 │Interface │ Attribute │ Value │
41 ├─────────────┼───────────────┼────────────────────────┤
42 │setlogmask() │ Thread safety │ MT-Unsafe race:LogMask │
43 └─────────────┴───────────────┴────────────────────────┘
44
46 POSIX.1-2001, POSIX.1-2008.
47
49 closelog(3), openlog(3), syslog(3)
50
52 This page is part of release 5.02 of the Linux man-pages project. A
53 description of the project, information about reporting bugs, and the
54 latest version of this page, can be found at
55 https://www.kernel.org/doc/man-pages/.
56
57
58
59 2017-09-15 SETLOGMASK(3)