OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / original / man3 / setlogmask.3
1 .\" Copyright (C) 2001 Andries Brouwer <aeb@cwi.nl>.
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .TH SETLOGMASK 3  2001-10-05 "" "Linux Programmer's Manual"
24 .SH NAME
25 setlogmask \- set log priority mask
26 .SH SYNOPSIS
27 .nf
28 .B #include <syslog.h>
29 .sp
30 .BI "int setlogmask(int " mask );
31 .fi
32 .SH DESCRIPTION
33 A process has a log priority mask that determines which calls to
34 .BR syslog (3)
35 may be logged.
36 All other calls will be ignored.
37 Logging is enabled for the priorities that have the corresponding
38 bit set in
39 .IR mask .
40 The initial mask is such that logging is enabled for all priorities.
41 .LP
42 The
43 .BR setlogmask ()
44 function sets this logmask for the calling process,
45 and returns the previous mask.
46 If the mask argument is 0, the current logmask is not modified.
47 .LP
48 The eight priorities are
49 .BR LOG_EMERG ,
50 .BR LOG_ALERT ,
51 .BR LOG_CRIT ,
52 .BR LOG_ERR ,
53 .BR LOG_WARNING ,
54 .BR LOG_NOTICE ,
55 .BR LOG_INFO ,
56 and
57 .BR LOG_DEBUG .
58 The bit corresponding to a priority \fIp\fP is \fBLOG_MASK\fP(\fIp\fP).
59 Some systems also provide a macro \fBLOG_UPTO\fP(\fIp\fP) for the mask
60 of all priorities in the above list up to and including \fIp\fP.
61 .SH "RETURN VALUE"
62 This function returns the previous log priority mask.
63 .SH ERRORS
64 None.
65 .\" .SH NOTES
66 .\" The glibc logmask handling was broken in versions before glibc 2.1.1.
67 .SH "CONFORMING TO"
68 POSIX.1-2001.
69 Note that the description in POSIX.1-2001 is flawed.
70 .SH "SEE ALSO"
71 .BR closelog (3),
72 .BR openlog (3),
73 .BR syslog (3)