1.\"
2.\" Copyright (c) 2017 John Baldwin <jhb@FreeBSD.org>
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.Dd November 24, 2017
26.Dt sysdecode_kevent 3
27.Os
28.Sh NAME
29.Nm sysdecode_kevent ,
30.Nm sysdecode_kevent_fflags ,
31.Nm sysdecode_kevent_filter ,
32.Nm sysdecode_kevent_flags
33.Nd output description of kevent structure fields
34.Sh LIBRARY
35.Lb libsysdecode
36.Sh SYNOPSIS
37.In sysdecode.h
38.Ft void
39.Fn sysdecode_kevent_fflags "FILE *fp" "short filter" "int fflags" "int base"
40.Ft bool
41.Fn sysdecode_kevent_flags "FILE *fp" "int flags" "int *rem"
42.Ft const char *
43.Fn sysdecode_kevent_filter "int filter"
44.Sh DESCRIPTION
45These functions provide text descriptions of
46.Vt struct kevent
47fields.
48.Pp
49The
50.Fn sysdecode_kevent_fflags
51function outputs a text description of the
52.Fa fflags
53member of a
54.Vt struct kevent
55to the stream
56.Fa fp .
57For the
58.Dv EVFILT_READ ,
59.Dv EVFILT_WRITE ,
60.Dv EVFILT_VNODE ,
61.Dv EVFILT_PROC ,
62.Dv EVFILT_PROCDESC ,
63.Dv EVFILT_TIMER ,
64and
65.Dv EVFILT_USER
66filters,
67.Fn sysdecode_kevent_fflags
68outputs a bitmask of filter-specific
69.Dv NOTE_*
70flags as documented in
71.Xr kevent 2 .
72For other values of
73.Fa filter ,
74the value of
75.Fa fflags
76is output in the indicated
77.Fa base
78.Pq one of 8, 10, or 16 .
79.Pp
80The
81.Fn sysdecode_kevent_filter
82function returns a text description of the
83.Fa filter
84member of a
85.Vt struct kevent .
86.Dv NULL
87is returned if the
88.Fa filter
89value is unknown.
90.Pp
91The
92.Fn sysdecode_kevent_flags
93function outputs a text description of the
94.Fa flags
95member of a
96.Vt struct kevent
97to the stream
98.Fa fp .
99This function uses the same calling convention and formatting as the other
100functions described in
101.Xr sysdecode_mask 3 .
102.Sh RETURN VALUES
103The
104.Nm sysdecode_kevent_filter
105function returns the name of a filter or
106.Dv NULL if the filter value is unknown.
107.Pp
108The
109.Nm sysdecode_kevent_flags
110function returns
111.Dv true
112if any flags in the
113.Fa flags
114field were decoded and
115.Dv false
116if no flags were decoded.
117.Sh SEE ALSO
118.Xr sysdecode 3 ,
119.Xr sysdecode_enum 3 ,
120.Xr sysdecode_mask 3
121