svn commit: r365268 - in head: sbin/sysctl sys/kern

John Baldwin jhb at FreeBSD.org
Wed Sep 2 18:43:59 UTC 2020


On 9/2/20 11:17 AM, Mark Johnston wrote:
> Author: markj
> Date: Wed Sep  2 18:17:08 2020
> New Revision: 365268
> URL: https://svnweb.freebsd.org/changeset/base/365268
> 
> Log:
>   Add sysctl(8) formatting for hw.pagesizes.
>   
>   - Change the type of hw.pagesizes to OPAQUE, since it returns an array.
>   - Modify the handler to only truncate the returned length if the caller
>     supplied an output buffer.  This allows use of the trick of passing a
>     NULL output buffer to fetch the output size, while preserving
>     compatibility if MAXPAGESIZES is increased.
>   - Add a "S,pagesize" formatter to sysctl(8).

Doesn't sysctl(8) handle scalar types that are arrays?  That is, couldn't
this change just be the change to not truncate 'len' without needing to make
it opaque and needing a custom printer, etc.?

-- 
John Baldwin


More information about the svn-src-all mailing list