HomeFreeBSD

Use kinfo_getfile() to implement fdwalk().

Description

Use kinfo_getfile() to implement fdwalk().

Previously, the kern.file sysctl (which queries the global file table)
was queried and the results saved in an on-stack buffer. With a
sufficiently active system the sysctl's output could overflow the
stack's available space. Instead, switch to kinfo_getfile() from
libutil. This uses a sysctl which queries only the open files for the
current process, and it uses heap space instead of the stack to store
the sysctl output.

PR: 253602
Submitted by: ps (build glue patches)
Reported by: ps
Reviewed by: bapt
MFH: 2021Q1
Differential Revision: https://reviews.freebsd.org/D28904

Details

Provenance
jhbAuthored on
Reviewer
bapt
Differential Revision
D28904: Use kinfo_getfile() to implement fdwalk().
Parents
rP566631: math/cmh: Update 1.0.20200923 -> 1.1.0
Branches
Unknown
Tags
Unknown