sysctl (io-sock)

Updated: April 19, 2023

Get or set the state of the socket manager

Runs on:

QNX Neutrino

Description:

The sysctl utility retrieves the state of the socket manager and allows processes with appropriate privilege to set the state. The variable to retrieve or set is described using a Management Information Base (MIB) style name, described as a dotted set of components.

The sysctl utility that QNX Neutrino provides for use with io-sock is ported from FreeBSD. It supports additional MIB-style names that are specific to io-sock and removes support for any standard variables that io-sock doesn't require.

Otherwise, sysctl for io-sock supports the same options and features as the standard FreeBSD sysctl. (An exception is the -h option, which you can specify, but io-sock ignores it.)

For a description of the standard version of sysctl, including option descriptions, see the FreeBSD documentation (https://www.freebsd.org/cgi/man.cgi?query=sysctl&sektion=8&manpath=FreeBSD+13.0-RELEASE+and+Ports).

Variables

The variables that are available to you depend on what you're running on your machine; the io-sock-specific variables that are likely of most interest are listed below. For information about determining the meaning of other variables, see the FreeBSD docs for sysctl() and sysctlbyname() (https://www.freebsd.org/cgi/man.cgi?query=sysctl&sektion=3&manpath=FreeBSD+13.0-RELEASE+and+Ports).

A process with appropriate privilege can change the value of any variables that are not read-only. All values are integers unless otherwise indicated.

These variables are for use with the io-sock context and process. They do not apply to the filesystem, environment, or the QNX Neutrino kernel.

qnx.sec.droproot
When you set this variable, io-sock stops running as root and switches to the specified user. For example:
sysctl qnx.sec.droproot=value

where value specifies a user, one or more groups, or both, using one of the following formats:

  • uid[:gid[,sup_gid]*]
  • user_name[,sup_gid]*

The default is 99:99,120. In the second format, the primary group is the one specified for user_name in /etc/passwd.

For more information about io-sock abilities, see “Privilege control.”

qnx.sec.transition
When you set this variable, io-sock continues running with the same uid it was started with, but switches to a different security type, most likely with fewer abilities:
sysctl qnx.sec.transition=1

The sysctl design means it's necessary to pass in some non-zero value; passing in 1 is recommended because future releases could assign specific meanings to other parameter values.

Because the new security type depends on the security policies you've defined for the system, this variable is useful only if the system uses security policies. For more information, see “Security Policies” in the System Security Guide.

For more information about io-sock abilities, see “Privilege control.”

Plug and Play variables
All have a default value of 1.
  • qnx.pnp.pci
  • qnx.pnp.ofwbus
  • qnx.pnp.usb
Version information variables
Currently, all have a value of 1 (inital version).
  • qnx.driver.smsc
  • qnx.driver.cdce
  • qnx.driver.axge
  • qnx.driver.axe
  • qnx.driver.re
  • qnx.driver.ixgbe
  • qnx.driver.em
  • qnx.driver.dwc
  • qnx.driver.libusbdci
  • qnx.driver.libpci
  • qnx.driver.phy
  • qnx.driver.libfdt

Tunables

The sysctl utility provided for use with io-sock does not support the FreeBSD loader program or loader.config, which can be used to initalize some of the variables that cannot be modified during normal system operation. However, some of the variables set via loader.conf (tunables) can instead be initialized via the file specified by the config option that io-sock provides.

In addition, the following io-sock-specific tunables are available:

qnx.typed_mem
Specify a typed memory region for mbuf allocation. When using mbuf zones or the DMA mapping interface (bus_dma), memory is allocated from the specified typed memory region.

For example, to specify the region /memory/below4G/ram/iosock, include the following line in the configuration file:

 qnx.typed_mem="/memory/below4G/ram/iosock" 

For AArch64 targets, the typed memory region you specify must be Normal memory. Using Device memory is not supportedOn aarch64 there is both "Normal" memory and "Device" memory. "Device" memory has some restrictions, including that all memory accesses must be aligned. io-sock may make unaligned accesses to memory, so any POSIX Typed Memory region specified in the io-sock config file with "qnx.typed_mem" must be "Normal" memory.

qnx.ipv4idrsvd
Specify identifiers that are reserved (i.e., that io-sock does not use) by providing the minimum identifier value for io-sock. Must be a value between 2 and 8192 and a power of 2. (For no reserved identifiers, specify no value or 0.)

Any identifiers lower than the specified value can instead be used by any application by setting the IP_HDRINCL socket option and providing the complete IPv4 header. For information about socket options, see https://www.freebsd.org/cgi/man.cgi?query=getsockopt&sektion=2&manpath=FreeBSD+13.0-RELEASE.

For more information on setting config, see io-sock.