Page MenuHomeFreeBSD

Permit sysctl(8) to set an array of numeric values for a single node.
ClosedPublic

Authored by jhb on Mar 2 2018, 11:43 PM.
Tags
None
Referenced Files
F87380008: D14569.diff
Tue, Jul 2, 9:19 AM
Unknown Object (File)
May 23 2024, 9:25 AM
Unknown Object (File)
May 14 2024, 8:43 AM
Unknown Object (File)
May 14 2024, 7:50 AM
Unknown Object (File)
Mar 15 2024, 7:43 PM
Unknown Object (File)
Mar 15 2024, 7:41 PM
Unknown Object (File)
Mar 15 2024, 7:40 PM
Unknown Object (File)
Mar 12 2024, 12:31 AM

Details

Summary

Most sysctl nodes only return a single value, but some nodes return an
array of values (e.g. kern.cp_time). sysctl(8) understand how to display
the values of a node that returns multiple values (it prints out each
numeric value separated by spaces). However, until now sysctl(8) has
only been able to set sysctl nodes to a single value. This change
allows sysctl to accept a new value for a numeric sysctl node that contains
multiple values separated by either spaces or commas. sysctl(8) parses
this list into an array of values and passes the array as the "new" value
to sysctl(2).

Test Plan
  • used with a sysctl in the cxgbe TLS TOE patches that add a writable sysctl node that holds an array of integer values (tls_rx_ports).

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Modulo adding a comment, LGTM.

sbin/sysctl/sysctl.c
329 ↗(On Diff #39899)

A comment explaining why CTLTYPE_STRING is intentionally leftout of this switch would be good.

This revision is now accepted and ready to land.Mar 9 2018, 10:47 PM
This revision was automatically updated to reflect the committed changes.