Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F160427947
D28642.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
5 KB
Referenced Files
None
Subscribers
None
D28642.diff
View Options
diff --git a/contrib/mandoc/mandocdb.c b/contrib/mandoc/mandocdb.c
--- a/contrib/mandoc/mandocdb.c
+++ b/contrib/mandoc/mandocdb.c
@@ -279,7 +279,7 @@
{ NULL, 0, 0 }, /* Sm */
{ NULL, 0, 0 }, /* Sx */
{ NULL, TYPE_Sy, 0 }, /* Sy */
- { NULL, TYPE_Tn, 0 }, /* Tn */
+ { NULL, 0, 0 }, /* Tn */
{ NULL, 0, NODE_NOSRC }, /* Ux */
{ NULL, 0, 0 }, /* Xc */
{ NULL, 0, 0 }, /* Xo */
@@ -1698,6 +1698,21 @@
{
char *cp;
+ /*
+ * Special case ".It Va" when found inside "LOADER TUNABLES"
+ * or "SYSCTL VARIABLES" sections.
+ */
+ if (n->tok == MDOC_Va && n->parent != NULL && n->parent->tok == MDOC_It &&
+ (n->sec == SEC_LOADER || n->sec == SEC_SYSCTL)) {
+ cp = NULL;
+ deroff(&cp, n);
+ if (cp != NULL) {
+ putkey(mpage, cp, TYPE_tun);
+ free(cp);
+ }
+ return 0;
+ }
+
if (n->type != ROFFT_ELEM && n->type != ROFFT_BODY)
return 0;
diff --git a/contrib/mandoc/mansearch.h b/contrib/mandoc/mansearch.h
--- a/contrib/mandoc/mansearch.h
+++ b/contrib/mandoc/mansearch.h
@@ -43,7 +43,7 @@
#define TYPE_Cd 0x0000000000002000ULL
#define TYPE_Va 0x0000000000004000ULL
#define TYPE_Ft 0x0000000000008000ULL
-#define TYPE_Tn 0x0000000000010000ULL
+#define TYPE_tun 0x0000000000010000ULL
#define TYPE_Er 0x0000000000020000ULL
#define TYPE_Ev 0x0000000000040000ULL
#define TYPE_Sy 0x0000000000080000ULL
diff --git a/contrib/mandoc/mansearch.c b/contrib/mandoc/mansearch.c
--- a/contrib/mandoc/mansearch.c
+++ b/contrib/mandoc/mansearch.c
@@ -55,7 +55,7 @@
const char *const mansearch_keynames[KEY_MAX] = {
"arch", "sec", "Xr", "Ar", "Fa", "Fl", "Dv", "Fn",
"Ic", "Pa", "Cm", "Li", "Em", "Cd", "Va", "Ft",
- "Tn", "Er", "Ev", "Sy", "Sh", "In", "Ss", "Ox",
+ "_tun", "Er", "Ev", "Sy", "Sh", "In", "Ss", "Ox",
"An", "Mt", "St", "Bx", "At", "Nx", "Fx", "Lk",
"Ms", "Bsx", "Dx", "Rs", "Vt", "Lb", "Nm", "Nd"
};
diff --git a/contrib/mandoc/mdoc_validate.c b/contrib/mandoc/mdoc_validate.c
--- a/contrib/mandoc/mdoc_validate.c
+++ b/contrib/mandoc/mdoc_validate.c
@@ -265,6 +265,8 @@
"LIBRARY",
"SYNOPSIS",
"DESCRIPTION",
+ "LOADER TUNABLES",
+ "SYSCTL VARIABLES",
"CONTEXT",
"IMPLEMENTATION NOTES",
"RETURN VALUES",
diff --git a/contrib/mandoc/roff.h b/contrib/mandoc/roff.h
--- a/contrib/mandoc/roff.h
+++ b/contrib/mandoc/roff.h
@@ -36,6 +36,8 @@
SEC_LIBRARY,
SEC_SYNOPSIS,
SEC_DESCRIPTION,
+ SEC_LOADER,
+ SEC_SYSCTL,
SEC_CONTEXT,
SEC_IMPLEMENTATION, /* IMPLEMENTATION NOTES */
SEC_RETURN_VALUES,
diff --git a/share/man/man4/ixl.4 b/share/man/man4/ixl.4
--- a/share/man/man4/ixl.4
+++ b/share/man/man4/ixl.4
@@ -210,7 +210,7 @@
Enabled by default; disable to mimic the TX behavior found in
.Xr ixgbe 4 .
.El
-.Sh SYSCTL PROCEDURES
+.Sh SYSCTL VARIABLES
.Bl -tag -width indent
.It Va dev.ixl.#.fc
Sets the 802.3x flow control mode that the adapter will advertise on the link.
diff --git a/share/man/man5/style.mdoc.5 b/share/man/man5/style.mdoc.5
--- a/share/man/man5/style.mdoc.5
+++ b/share/man/man5/style.mdoc.5
@@ -40,8 +40,6 @@
.Fx
source tree.
.Ss Code Examples
-.Bl -dash -width ""
-.It
Use literal formatting for examples and literal shell commands, e.g.:
.Bd -literal -offset indent
Then run
@@ -67,10 +65,7 @@
Then run
.Dq Nm make Cm install Cm clean .
.Ed
-.El
.Ss EXAMPLES Section
-.Bl -dash -width ""
-.It
Format the
.Sx EXAMPLES
section in the following way:
@@ -112,10 +107,7 @@
It is good to know this command.
.El
.Ed
-.El
.Ss Synopsis Formatting
-.Bl -dash -width ""
-.It
Do not put whitespace between alternative parameters separated with a pipe
.Pq Dq | ,
e.g.:
@@ -129,7 +121,7 @@
.Cm compression Cm on Ns | Ns Cm off
.Cm install Fl -all Ns | Ns Ar portname Ar ...
.Ed
-.It
+.Pp
Use
.Sy \&Cm
to stylize characters that are command modifiers
@@ -181,8 +173,6 @@
flag.
.El
.Ss Quoting
-.Bl -dash -width ""
-.It
Use the
.Sy \&Dq
.Pq Do Dc
@@ -196,19 +186,46 @@
.Sy \&Qq
.Pq Qo Qc
macro is usually not necessary.
-.El
-.Ss Variables
-.Bl -dash -width ""
-.It
-Use
+.Ss Loader Tunables And Sysctl Variables
+Loader tunables and sysctl variables should be documented in
+.Qq LOADER TUNABLES
+and
+.Qq SYSCTL VARIABLES
+sections, respectively.
+Both sections should provide them inside an
+.Sy \&Bl -tag
+list block using the
.Sy \&Va
-instead of
-.Sy \&Dv
-for
-.Xr sysctl 8
-variables like
-.Va kdb.enter.panic .
-.It
+macro.
+Note that
+.Xr makewhatis 8
+only special cases them if found after the
+.Sy \&It
+macro, and for
+.Xr man 1
+to be able to do tunable/sysctl search, the following format should be used:
+.Bd -literal -offset indent
+\&.Sh LOADER TUNABLES
+Tunables can be set at the
+\&.Xr loader 8
+prompt before booting the kernel or stored in
+\&.Xr loader.conf 5 .
+\&.Bl -tag -width indent
+\&.It Va some.loader.tunable
+Tunable description.
+\&.El
+\&.Sh SYSCTL VARIABLES
+The following variables are available as both
+\&.Xr sysctl 8
+variables and
+\&.Xr loader 8
+tunables:
+\&.Bl -tag -width indent
+\&.It Va some.sysctl.variable
+Variable description.
+\&.El
+.Ed
+.Ss Variables
Use the angle brackets
.Sy \&Aq
.Pq Dq "<>"
@@ -238,7 +255,6 @@
.Bd -filled -offset indent
.Va critical_filesystems_ Ns Ar type
.Ed
-.El
.Sh SEE ALSO
.Xr man 1 ,
.Xr mandoc 1 ,
diff --git a/usr.bin/man/man.sh b/usr.bin/man/man.sh
--- a/usr.bin/man/man.sh
+++ b/usr.bin/man/man.sh
@@ -532,7 +532,16 @@
done
unset IFS
- # Nothing? Well, we are done then.
+ # Nothing? Try looking for loader/sysctl tunable.
+ if [ -z "$found_page" ]; then
+ path=$(apropos -w _tun="$1" 2>/dev/null)
+ if [ $? = 0 ]; then
+ found_page=yes
+ man_find_and_display $path
+ fi
+ fi
+
+ # Still nothing? Well, we are done then.
if [ -z "$found_page" ]; then
echo "No manual entry for $1" >&2
ret=1
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jun 25, 8:11 AM (7 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34316332
Default Alt Text
D28642.diff (5 KB)
Attached To
Mode
D28642: man: implement sysctl search
Attached
Detach File
Event Timeline
Log In to Comment