summaryrefslogtreecommitdiff
path: root/lib/libdevinfo/devinfo.c
Commit message (Collapse)AuthorAgeFilesLines
* devinfo: fix memory leak on error pathsEric van Gyzen2020-08-041-9/+23
| | | | | | | | | | | | Refactor to create devinfo_free_dev(). Call it to plug a memory leak on two error paths in devinfo_init_devices(). Reported by: Coverity MFC after: 2 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=363866
* Update to device enumeration protocol 2Warner Losh2018-05-311-14/+28
| | | | | | | | | | | The new protocol from the kernel encodes things as a string table, extract it into fields. strdup the strings, and free them when we're done. Differential Revision: https://reviews.freebsd.org/D15629 Notes: svn path=/head/; revision=334415
* Sanity check the return from the kernel.Warner Losh2018-05-311-0/+5
| | | | | | | | | | | We should be getting back as many bytes as we asked for, and we don't handle shortages at all, so just reject anything that's not right. Differential Revision: https://reviews.freebsd.org/D15629 Notes: svn path=/head/; revision=334413
* There's no meaningful errno when there's a version mismatch, so useWarner Losh2018-05-301-1/+2
| | | | | | | warnx. Also, report the mis-matched versions. Notes: svn path=/head/; revision=334383
* Bump number that's an insane number of devices from 1,000 to 10,000. IWarner Losh2017-12-211-1/+1
| | | | | | | | | | | have access to machines that are pushing 400 devices. When 1,000 was selected, it was rare to get even 40 or 50 devices. Bump the limit by 10x to keep up with the times. Sponsored by: Netflix Notes: svn path=/head/; revision=327054
* lib: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-261-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using mis-identified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326219
* Make the variadic macro debug() comply to C99.Stefan Farfeleder2006-07-171-3/+6
| | | | Notes: svn path=/head/; revision=160428
* Clear devinfo_generation in devinfo_free() since we are freeing all of theJohn Baldwin2005-06-221-0/+1
| | | | | | | | | | | | | | | | cached state. Otherwise, a subsequent call to devinfo_init() would succeed without reading the device tree from the kernel thinking that the cached state was up to date since the generation count was the same. However, since the cached state was actually free'd, attempts to examine the tree after the second devinfo_init() would fail. Reported by: Juho Vuori juho dot vuori at kepa dot fi Submitted by: Stefan Farfeleder stefan at fafoe dot narf dot at Approved by: re (dwhite) MFC after: 1 week Notes: svn path=/head/; revision=147529
* Remove unused variables. Whitespace cleaning.Philippe Charnier2005-05-201-13/+13
| | | | Notes: svn path=/head/; revision=146441
* Fix typo in a comment.Stefan Farfeleder2005-03-011-1/+1
| | | | Notes: svn path=/head/; revision=142951
* Prefer C99's __func__ over GCC's __FUNCTION__.Stefan Farfeleder2004-09-221-1/+1
| | | | Notes: svn path=/head/; revision=135576
* Expose the new kernel data structures to libdevinfo:Warner Losh2002-09-201-3/+12
| | | | | | | | | o Added dd_pnpinfo, dd_location, dd_devflags, dd_flags and dd_state o Copy/initialize these as necessary. o Document the changes to the interface in devinfo.3. Notes: svn path=/head/; revision=103662
* Implement __FBSDID()Matthew Dillon2001-09-161-2/+3
| | | | Notes: svn path=/head/; revision=83551
* Include string.h for the strlen() prototype to quiet a warning.John Baldwin2001-08-101-0/+1
| | | | Notes: svn path=/head/; revision=81459
* This is the Device Information Library, libdevinfo.Mike Smith2001-04-201-0/+488
The devinfo library provides access to the kernel's internal device hierarchy and to the I/O resource manager. The library uses a sysctl(9) interface to obtain a snapshot of the kernel's state which is then made available to the application. Notes: svn path=/head/; revision=75726