]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man9/devctl_notify.9
accept_filter(9): Fix a mandoc related error
[FreeBSD/FreeBSD.git] / share / man / man9 / devctl_notify.9
1 .\"
2 .\" Copyright (c) 2020 M Warner Losh
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 DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
14 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
15 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
16 .\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
17 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 .\"
24 .\" $FreeBSD$
25 .\"
26 .Dd September 22, 2020
27 .Dt DEVCTL_NOTIFY 9
28 .Os
29 .Sh NAME
30 .Nm devctl_notify
31 .Nd Send a message, via devctl, to userland
32 .Sh SYNOPSIS
33 .In sys/devctl.h
34 .Ft void
35 .Fn devctl_notify "const char *system" "const char *subsystem" "const char *type" "const char *data"
36 .Sh DESCRIPTION
37 Send a notification to user land via
38 .Xr devctl 4 .
39 See
40 .Xr devctl 4
41 for the format of these messages.
42 .Pp
43 The
44 .Nm
45 function creates a string using the following template:
46 .Bd -literal
47 snprintf(buffer, sizeof(buffer), "!system=%s subsystem=%s type=%s",
48    system, subsystem, type);
49 .Ed
50 .Pp
51 The
52 .Va system ,
53 .Va subsystem ,
54 and
55 .Va type
56 pointers cannot be NULL.
57 .Pp
58 The
59 .Va data
60 argument may be NULL (for no additions) or a message formatted
61 properly for
62 .Xr devctl 4 .
63 A space will be added to the above template and this argument copied
64 verbatim to form the message passed to userland.
65 Senders should balance between only passing data that userland can not
66 discover itself and sending all the data userland will want to use to
67 decide what to do with the message.
68 .Pp
69 The current total message length limit is just under 1kb.
70 Senders should try to remain well below this limit.
71 .Sh SEE ALSO
72 .Xr devctl 4 ,
73 .Xr devd 8
74 .Sh AUTHORS
75 This manual page was written by
76 .An M. Warner Losh