1setlogmask(3)              Library Functions Manual              setlogmask(3)
2
3
4

NAME

6       setlogmask - set log priority mask
7

LIBRARY

9       Standard C library (libc, -lc)
10

SYNOPSIS

12       #include <syslog.h>
13
14       int setlogmask(int mask);
15

DESCRIPTION

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

RETURN VALUE

33       This function returns the previous log priority mask.
34

ERRORS

36       None.
37

ATTRIBUTES

39       For an  explanation  of  the  terms  used  in  this  section,  see  at‐
40       tributes(7).
41
42       ┌─────────────────────────────┬───────────────┬────────────────────────┐
43Interface                    Attribute     Value                  
44       ├─────────────────────────────┼───────────────┼────────────────────────┤
45setlogmask()                 │ Thread safety │ MT-Unsafe race:LogMask │
46       └─────────────────────────────┴───────────────┴────────────────────────┘
47

STANDARDS

49       POSIX.1-2008.
50

HISTORY

52       POSIX.1-2001.
53
54       LOG_UPTO() will be included in the next release of the POSIX specifica‐
55       tion (Issue 8).
56

SEE ALSO

58       closelog(3), openlog(3), syslog(3)
59
60
61
62Linux man-pages 6.04              2023-03-30                     setlogmask(3)
Impressum