1setlogmask(3) Library Functions Manual setlogmask(3)
2
3
4
6 setlogmask - set log priority mask
7
9 Standard C library (libc, -lc)
10
12 #include <syslog.h>
13
14 int setlogmask(int mask);
15
17 A process has a log priority mask that determines which calls to sys‐
18 log(3) may be logged. All other calls will be ignored. Logging is en‐
19 abled for the priorities that have the corresponding bit set in mask.
20 The initial mask is such that logging is enabled for all priorities.
21
22 The setlogmask() function sets this logmask for the calling process,
23 and returns the previous mask. If the mask argument is 0, the current
24 logmask is not modified.
25
26 The eight priorities are LOG_EMERG, LOG_ALERT, LOG_CRIT, LOG_ERR,
27 LOG_WARNING, LOG_NOTICE, LOG_INFO, and LOG_DEBUG. The bit correspond‐
28 ing to a priority p is LOG_MASK(p). Some systems also provide a macro
29 LOG_UPTO(p) for the mask of all priorities in the above list up to and
30 including p.
31
33 This function returns the previous log priority mask.
34
36 None.
37
39 For an explanation of the terms used in this section, see at‐
40 tributes(7).
41
42 ┌─────────────────────────────┬───────────────┬────────────────────────┐
43 │Interface │ Attribute │ Value │
44 ├─────────────────────────────┼───────────────┼────────────────────────┤
45 │setlogmask() │ Thread safety │ MT-Unsafe race:LogMask │
46 └─────────────────────────────┴───────────────┴────────────────────────┘
47
49 POSIX.1-2008.
50
52 POSIX.1-2001.
53
54 LOG_UPTO() will be included in the next release of the POSIX
55 specification (Issue 8).
56
58 closelog(3), openlog(3), syslog(3)
59
60
61
62Linux man-pages 6.05 2023-07-20 setlogmask(3)