The manpage incorrectly describes the behaviour and usage of
pci_mapreg_probe(9). This function does not return 0 for success and !0
for failure as described in the manual, see the diff below for a
possible re-wording and corrected description.

Index: share/man/man9/pci_mapreg_map.9
===================================================================
RCS file: /cvs/src/share/man/man9/pci_mapreg_map.9,v
retrieving revision 1.1
diff -u -p -r1.1 pci_mapreg_map.9
--- share/man/man9/pci_mapreg_map.9     23 Feb 2019 04:54:25 -0000      1.1
+++ share/man/man9/pci_mapreg_map.9     8 Jan 2022 20:36:07 -0000
@@ -127,20 +127,34 @@ pointers.
 .Nm pci_mapreg_probe
 attempts to determine if the BAR referenced by
 .Fa reg
-describes a valid register mapping.
+describes a valid register mapping. If the mapping is valid the register type
+will be updated via the pointer
+.Fa *typep
+to either
+.Dv PCI_MAPREG_TYPE_IO
+or
+.Dv PCI_MAPREG_TYPE_MEM .
+If the mapping is invalid the register type should not be used.
+.Fa *typep
+can be
+.Dv NULL
+if determining the register type is not desired.
 .Pp
 .Nm pci_mapreg_type
 returns the type of register access for the registers at the BAR
 referenced by
 .Fa reg .
 .Sh RETURN VALUES
-.Nm pci_mapreg_map ,
-.Nm pci_mapreg_info ,
-and
-.Nm pci_mapreg_probe
-return 0 on success, or an
+.Nm pci_mapreg_map and
+.Nm pci_mapreg_info 
+return zero on success, or an
 .Xr errno 2
 style value on failure.
+.Pp
+.Nm pci_mapreg_probe
+returns zero when no register is found or one if it finds a
+register at the BAR referenced by
+.Fa reg .
 .Pp
 .Nm pci_mapreg_type
 returns either



-- 
Ted Bullock <[email protected]>

Reply via email to