freebsd-nq/share
John Baldwin 10012d5309 Reliably return PCI_GETCONF_LAST_DEVICE from PCIOCGETCONF.
Previously the loop in PCIIOCGETCONF would terminate as soon as it
found enough matches.  Now it will continue iterating through the
PCI device list and only terminate if it finds another matching device
for which it has no room to store a conf structure.  This means that
PCI_GETCONF_LAST_DEVICE is reliably returned when the number of
matching devices is equal to the number of slots in the matches
buffer.  For example, if a program requests the conf structure for a
single PCI function with a specified domain/bus/slot/function it will
now get PCI_GETCONF_LAST_DEVICE instead of PCI_GETCONF_MORE_DEVS.

While here, simplify the loop conditional a bit more by explicitly
breaking out of the loop if copyout() fails and removing a redundant
i < pci_numdevs check.

Reviewed by:	vangyzen, imp
MFC after:	1 month
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D7445
2016-08-09 17:57:11 +00:00
..
colldef Add the forgotten "svn mv" from r302329 2016-07-03 19:31:21 +00:00
ctypedef Posixify the locales name for variants 2016-07-03 18:21:11 +00:00
dict Add META_MODE support. 2015-06-13 19:20:56 +00:00
doc Don't repeat the the word 'the' 2016-05-17 12:52:31 +00:00
dtrace Remove the old version of the DTraceToolkit from the source tree. 2016-05-19 19:51:39 +00:00
examples Install/Connect ypldap.conf(5) on examples. 2016-06-06 02:43:41 +00:00
i18n Remove exists() checks so normal out-of-date handling can be used. 2016-03-11 23:45:36 +00:00
keys META MODE: Update dependencies with 'the-lot' and add missing directories. 2015-12-01 05:23:19 +00:00
man Reliably return PCI_GETCONF_LAST_DEVICE from PCIOCGETCONF. 2016-08-09 17:57:11 +00:00
me Add META_MODE support. 2015-06-13 19:20:56 +00:00
misc Update with the members of the 9th core team. 2016-08-06 17:53:53 +00:00
mk libproc: Add proc_getmodel(). 2016-07-30 03:09:23 +00:00
monetdef Posixify the locales name for variants 2016-07-03 18:21:11 +00:00
msgdef Posixify the locales name for variants 2016-07-03 18:21:11 +00:00
numericdef Posixify the locales name for variants 2016-07-03 18:21:11 +00:00
security META MODE: These need object directories to handle staging. 2015-11-26 01:14:27 +00:00
sendmail Update share/examples/* to properly install /usr/share/examples. 2016-05-10 00:51:50 +00:00
skel Use more appropriate ${SHAREDIR} rather than /usr/share. 2015-10-27 23:35:02 +00:00
snmp Add META_MODE support. 2015-06-13 19:20:56 +00:00
syscons DIRDEPS_BUILD: Run the staged bootstrap-tools version of build-tools. 2016-05-09 22:21:09 +00:00
tabset Add META_MODE support. 2015-06-13 19:20:56 +00:00
termcap Replace ln -s calls with INSTALL_SYMLINK 2015-12-04 03:17:14 +00:00
tests Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
timedef Add a hack to add weekday to date format for ko_KR locale. 2016-07-27 18:12:36 +00:00
vt Remove uudecode make rule for vt fonts 2016-02-29 18:35:16 +00:00
zoneinfo Reimplement r301944 using the correct install(1) invocation, which again 2016-06-16 13:34:20 +00:00
Makefile Posixify the locales name for variants 2016-07-03 18:21:11 +00:00
Makefile.inc