1.\" $OpenBSD: sysctl.2,v 1.44 2021/05/18 05:26:26 claudio Exp $ 2.\" 3.\" Copyright (c) 1993 4.\" The Regents of the University of California. All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 3. Neither the name of the University nor the names of its contributors 15.\" may be used to endorse or promote products derived from this software 16.\" without specific prior written permission. 17.\" 18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28.\" SUCH DAMAGE. 29.\" 30.Dd $Mdocdate: May 18 2021 $ 31.Dt SYSCTL 2 32.Os 33.Sh NAME 34.Nm sysctl 35.Nd get or set system information 36.Sh SYNOPSIS 37.In sys/types.h 38.In sys/sysctl.h 39.Ft int 40.Fn sysctl "const int *name" "u_int namelen" "void *oldp" "size_t *oldlenp" "void *newp" "size_t newlen" 41.Sh DESCRIPTION 42The 43.Fn sysctl 44function retrieves system information and allows processes with 45appropriate privileges to set system information. 46The information available from 47.Fn sysctl 48consists of integers, strings, and tables. 49Information may be retrieved and set using the 50.Xr sysctl 8 51utility; 52the variable names used by this utility are given here in parentheses. 53.Pp 54Unless explicitly noted below, 55.Fn sysctl 56returns a consistent snapshot of the data requested. 57Consistency is obtained by locking the destination 58buffer into memory so that the data may be copied out without blocking. 59Calls to 60.Fn sysctl 61are serialized to avoid deadlock. 62.Pp 63The state is described using a 64.Dq Management Information Base (MIB) 65style name, listed in 66.Fa name , 67which is a 68.Fa namelen 69length array of integers. 70.Pp 71The information is copied into the buffer specified by 72.Fa oldp . 73The size of the buffer is given by the location specified by 74.Fa oldlenp 75before the call, 76and that location gives the amount of data copied after a successful call. 77If the amount of data available is greater 78than the size of the buffer supplied, 79the call supplies as much data as fits in the buffer provided 80and returns with the error code 81.Er ENOMEM . 82If the old value is not desired, 83.Fa oldp 84and 85.Fa oldlenp 86should be set to 87.Dv NULL . 88.Pp 89The size of the available data can be determined by calling 90.Fn sysctl 91with a 92.Dv NULL 93parameter for 94.Fa oldp . 95The size of the available data will be returned in the location pointed to by 96.Fa oldlenp . 97For some operations, the amount of space may change often. 98For these operations, 99the system attempts to round up so that the returned size is 100large enough for a call to return the data shortly thereafter. 101.Pp 102The terminating NUL character is included in the lengths of string values. 103.Pp 104To set a new value, 105.Fa newp 106is set to point to a buffer of length 107.Fa newlen 108from which the requested value is to be taken. 109If a new value is not to be set, 110.Fa newp 111should be set to 112.Dv NULL 113and 114.Fa newlen 115set to 0. 116.Pp 117The top level names are defined with a 118.Dv CTL_ 119prefix in 120.In sys/sysctl.h , 121and are as follows. 122The next and subsequent levels down are found in the include files 123listed here, and described in separate sections below. 124.Bl -column "CTL_MACHDEP" "ufs/ffs/ffs_extern.h" "Description" -offset indent 125.It Sy "Name" Ta Sy "Next level names" Ta Sy "Description" 126.It Dv CTL_DDB Ta "ddb/db_var.h" Ta "Kernel debugger" 127.It Dv CTL_DEBUG Ta "sys/sysctl.h" Ta "Debugging" 128.It Dv CTL_FS Ta "sys/sysctl.h" Ta "File system" 129.It Dv CTL_HW Ta "sys/sysctl.h" Ta "Generic CPU, I/O" 130.It Dv CTL_KERN Ta "sys/sysctl.h" Ta "High kernel limits" 131.It Dv CTL_MACHDEP Ta "sys/sysctl.h" Ta "Machine dependent" 132.It Dv CTL_NET Ta "sys/socket.h" Ta "Networking" 133.It Dv CTL_VFS Ta "ufs/ffs/ffs_extern.h" Ta "Virtual file system" 134.It Dv CTL_VM Ta "uvm/uvm_param.h" Ta "Virtual memory" 135.El 136.Pp 137For example, the following retrieves the maximum number of processes allowed 138in the system: 139.Bd -literal -offset indent 140int mib[2], maxproc; 141size_t len; 142 143mib[0] = CTL_KERN; 144mib[1] = KERN_MAXPROC; 145len = sizeof(maxproc); 146if (sysctl(mib, 2, &maxproc, &len, NULL, 0) == -1) 147 err(1, "sysctl"); 148.Ed 149.Ss CTL_DDB 150Integer information and settable variables are available for the 151.Dv CTL_DDB level , 152as described below. 153More information is also available in 154.Xr ddb 4 . 155.Bl -column "Second level name" "integer" "Changeable" -offset indent 156.It Sy "Second level name" Ta Sy "Type" Ta Sy "Changeable" 157.It Dv DBCTL_CONSOLE Ta "integer" Ta "yes" 158.It Dv DBCTL_LOG Ta "integer" Ta "yes" 159.It Dv DBCTL_MAXLINE Ta "integer" Ta "yes" 160.It Dv DBCTL_MAXWIDTH Ta "integer" Ta "yes" 161.It Dv DBCTL_PANIC Ta "integer" Ta "yes" 162.It Dv DBCTL_RADIX Ta "integer" Ta "yes" 163.It Dv DBCTL_TABSTOP Ta "integer" Ta "yes" 164.It Dv DBCTL_TRIGGER Ta "integer" Ta "yes" 165.El 166.Bl -tag -width "123456" 167.It Dv DBCTL_CONSOLE Pq Va ddb.console 168When this variable is set, an architecture dependent magic key sequence 169on the console or a debugger button will permit entry into the kernel debugger. 170When running with a 171.Xr securelevel 7 172greater than 0, 173this variable may not be raised. 174.It Dv DBCTL_LOG Pq Va ddb.log 175When set, ddb output is also logged in the kernel message buffer. 176.It Dv DBCTL_MAXLINE Pq Va ddb.max_line 177Determines the number of lines to page in 178.Xr ddb 4 . 179This variable is also available as the ddb 180.Dv $lines 181variable. 182.It Dv DBCTL_MAXWIDTH Pq Va ddb.max_width 183Determines the maximum width of a line in 184.Xr ddb 4 . 185This variable is also available as the ddb 186.Dv $maxwidth 187variable. 188.It Dv DBCTL_PANIC Pq Va ddb.panic 189When this variable is set, system panics may drop into the kernel debugger. 190When running with a 191.Xr securelevel 7 192greater than 0, 193this variable may not be raised. 194.It Dv DBCTL_RADIX Pq Va ddb.radix 195Determines the default radix or base for non-prefixed numbers 196entered into 197.Xr ddb 4 . 198This variable is also available as the ddb 199.Dv $radix 200variable. 201.It Dv DBCTL_TABSTOP Pq Va ddb.tab_stop_width 202Width of a tab stop in 203.Xr ddb 4 . 204This variable is also available as the ddb 205.Dv $tabstops 206variable. 207.It Dv DBCTL_TRIGGER Pq Va ddb.trigger 208When 209.Dv DBCTL_CONSOLE 210is set, 211writing to 212.Dv DBCTL_TRIGGER 213causes the system to enter 214.Xr ddb 4 . 215When running with a 216.Xr securelevel 7 217greater than 0, 218the process writing to this variable must be running 219on the console in order to enter 220.Xr ddb 4 . 221.El 222.Ss CTL_DEBUG 223The debugging variables vary from system to system. 224A debugging variable may be added or deleted without need to recompile 225.Fn sysctl 226to know about it. 227Each time it runs, 228.Fn sysctl 229gets the list of debugging variables from the kernel and 230displays their current values. 231The system defines twenty 232.Vt struct ctldebug 233variables named 234.Va debug0 235through 236.Va debug19 . 237They are declared as separate variables so that they can be 238individually initialized at the location of their associated variable. 239The loader prevents multiple use of the same variable by issuing errors 240if a variable is initialized in more than one place. 241For example, to export the variable 242.Va dospecialcheck 243as a debugging variable, the following declaration would be used: 244.Bd -literal -offset indent 245int dospecialcheck = 1; 246struct ctldebug debug5 = { "dospecialcheck", &dospecialcheck }; 247.Ed 248.Ss CTL_FS 249The string and integer information available for the 250.Dv CTL_FS 251level is detailed below. 252The changeable column shows whether a process with appropriate 253privileges may change the value. 254.Bl -column "Second level name" "integer" "Changeable" -offset indent 255.It Sy "Second level name" Ta Sy "Type" Ta Sy "Changeable" 256.It Dv FS_POSIX_SETUID Ta "integer" Ta "yes" 257.El 258.Bl -tag -width "123456" 259.It Dv FS_POSIX_SETUID Pq Va fs.posix.setuid 260When this variable is set, ownership changes on a file will cause 261the 262.Va S_ISUID 263and 264.Va S_ISGID 265bits to be cleared. 266When running with a 267.Xr securelevel 7 268greater than 0, 269this variable may not be changed. 270.El 271.Ss CTL_HW 272The string and integer information available for the 273.Dv CTL_HW 274level is detailed below. 275The changeable column shows whether a process with appropriate 276privileges may change the value. 277.Bl -column "Second level name" "integer" "Changeable" -offset indent 278.It Sy "Second level name" Ta Sy "Type" Ta Sy "Changeable" 279.It Dv HW_ALLOWPOWERDOWN Ta "integer" Ta "yes" 280.It Dv HW_BYTEORDER Ta "integer" Ta "no" 281.It Dv HW_CPUSPEED Ta "integer" Ta "no" 282.It Dv HW_DISKCOUNT Ta "integer" Ta "no" 283.It Dv HW_DISKNAMES Ta "string" Ta "no" 284.It Dv HW_DISKSTATS Ta "struct" Ta "no" 285.It Dv HW_MACHINE Ta "string" Ta "no" 286.It Dv HW_MODEL Ta "string" Ta "no" 287.It Dv HW_NCPU Ta "integer" Ta "no" 288.It Dv HW_NCPUFOUND Ta "integer" Ta "no" 289.It Dv HW_NCPUONLINE Ta "integer" Ta "no" 290.It Dv HW_PAGESIZE Ta "integer" Ta "no" 291.It Dv HW_PERFPOLICY Ta "string" Ta "yes" 292.It Dv HW_PHYSMEM Ta "integer" Ta "no" 293.It Dv HW_PHYSMEM64 Ta "int64_t" Ta "no" 294.It Dv HW_PRODUCT Ta "string" Ta "no" 295.It Dv HW_SENSORS Ta "node" Ta "not applicable" 296.It Dv HW_SETPERF Ta "integer" Ta "yes" 297.It Dv HW_SMT Ta "integer" Ta "yes" 298.It Dv HW_USERMEM Ta "integer" Ta "no" 299.It Dv HW_USERMEM64 Ta "int64_t" Ta "no" 300.It Dv HW_UUID Ta "string" Ta "no" 301.It Dv HW_VENDOR Ta "string" Ta "no" 302.It Dv HW_VERSION Ta "string" Ta "no" 303.El 304.Bl -tag -width "123456" 305.It Dv HW_ALLOWPOWERDOWN Pq Va hw.allowpowerdown 306Some machines generate an interrupt when the power button is pressed 307and a driver can catch that interrupt. 308When this variable is set, such an event will cause the system to 309perform a regular shutdown and power off the machine. 310When running with a 311.Xr securelevel 7 312greater than 0, 313this variable may not be changed. 314.It Dv HW_BYTEORDER Pq Va hw.byteorder 315The byteorder (4321 or 1234). 316.It Dv HW_CPUSPEED Pq Va hw.cpuspeed 317The current CPU frequency 318.Pq in MHz . 319.It Dv HW_DISKCOUNT Pq Va hw.diskcount 320The number of disks currently attached to the system. 321.It Dv HW_DISKNAMES Pq Va hw.disknames 322A comma-separated list of disk names. 323.It Dv HW_DISKSTATS Pq Va hw.diskstats 324An array of 325.Vt struct diskstats 326structures containing disk statistics. 327.It Dv HW_MACHINE Pq Va hw.machine 328The machine class. 329.It Dv HW_MODEL Pq Va hw.model 330The machine model. 331.It Dv HW_NCPU Pq Va hw.ncpu 332The number of CPUs configured. 333.It Dv HW_NCPUFOUND Pq Va hw.ncpufound 334The number of CPUs found. 335.It Dv HW_NCPUONLINE Pq Va hw.ncpuonline 336The number of CPUs online. 337.It Dv HW_PAGESIZE Pq Va hw.pagesize 338The software page size. 339.It Dv HW_PERFPOLICY Pq Va hw.perfpolicy 340The performance policy for power management. 341Can be one of 342.Dq manual , 343.Dq auto , 344or 345.Dq high . 346.It Dv HW_PHYSMEM 347The total physical memory, in bytes. 348This variable is deprecated; use 349.Dv HW_PHYSMEM64 350instead. 351.It Dv HW_PHYSMEM64 Pq Va hw.physmem 352The total physical memory, in bytes. 353.It Dv HW_PRODUCT Pq Va hw.product 354The product name of the machine. 355.It Dv HW_SENSORS Pq Va hw.sensors 356Third level comprises an array of 357.Vt struct sensordev 358structures containing information about devices 359that may attach hardware monitoring sensors. 360.Pp 361Third, fourth and fifth levels together comprise an array of 362.Vt struct sensor 363structures containing snapshot readings of hardware monitoring sensors. 364In such usage, third level indicates the numerical representation 365of the sensor device name to which the sensor is attached 366(a device's xname and number are matched with the help of 367.Vt struct sensordev 368structure above), 369fourth level indicates sensor type and 370fifth level is an ordinal sensor number (unique to 371the specified sensor type on the specified sensor device). 372.Pp 373The 374.Sy sensordev 375and 376.Sy sensor 377structures 378and 379.Sy sensor_type 380enumeration 381are defined in 382.In sys/sensors.h . 383.It Dv HW_SERIALNO Pq Va hw.serialno 384The serial number of the machine. 385.It Dv HW_SETPERF Pq Va hw.setperf 386Current CPU performance 387.Pq percentage . 388It is only modifiable if 389.Dv HW_PERFPOLICY 390is set to 391.Dq manual . 392.It Dv HW_SMT Pq Va hw.smt 393If set to 1, enable simultaneous multithreading (SMT) on CPUs that 394support it. 395Disabled by default. 396.It Dv HW_USERMEM 397The amount of available non-kernel memory in bytes. 398This variable is deprecated; use 399.Dv HW_USERMEM64 400instead. 401.It Dv HW_USERMEM64 Pq Va hw.usermem 402The amount of available non-kernel memory in bytes. 403.It Dv HW_UUID Pq Va hw.uuid 404The universal unique identification number assigned to the machine. 405.It Dv HW_VENDOR Pq Va hw.vendor 406The vendor name for this machine. 407.It Dv HW_VERSION Pq Va hw.version 408The version or revision of this machine. 409.El 410.Ss CTL_KERN 411The string and integer information available for the 412.Dv CTL_KERN 413level is detailed below. 414The changeable column shows whether a process with appropriate 415privileges may change the value. 416The types of data currently available are process information, 417system vnodes, the open file entries, routing table entries, 418virtual memory statistics, load average history, and clock rate 419information. 420.Bl -column "KERN_PROC_NOBROADCASTKILL" "u_int64_t[CPUSTATES]" "no" -offset indent 421.It Sy "Second level name" Ta Sy "Type" Ta Sy "Changeable" 422.It Dv KERN_ALLOWDT Ta "integer" Ta "yes" 423.It Dv KERN_ALLOWKMEM Ta "integer" Ta "yes" 424.It Dv KERN_ARGMAX Ta "integer" Ta "no" 425.It Dv KERN_AUDIO Ta "node" Ta "yes" 426.It Dv KERN_BOOTTIME Ta "struct timeval" Ta "no" 427.It Dv KERN_CACHEPCT Ta "integer" Ta "yes" 428.It Dv KERN_CCPU Ta "integer" Ta "no" 429.It Dv KERN_CLOCKRATE Ta "struct clockinfo" Ta "no" 430.It Dv KERN_CONSDEV Ta "dev_t" Ta "no" 431.It Dv KERN_CPTIME Ta "long[CPUSTATES]" Ta "no" 432.It Dv KERN_CPTIME2 Ta "u_int64_t[CPUSTATES]" Ta "no" 433.It Dv KERN_CPUSTATS Ta "struct cpustats" Ta "no" 434.It Dv KERN_DOMAINNAME Ta "string" Ta "yes" 435.It Dv KERN_FILE Ta "struct kinfo_file" Ta "no" 436.It Dv KERN_FORKSTAT Ta "struct forkstat" Ta "no" 437.It Dv KERN_FSCALE Ta "integer" Ta "no" 438.It Dv KERN_FSYNC Ta "integer" Ta "no" 439.It Dv KERN_GLOBAL_PTRACE Ta "integer" Ta "yes" 440.It Dv KERN_HOSTID Ta "integer" Ta "yes" 441.It Dv KERN_HOSTNAME Ta "string" Ta "yes" 442.It Dv KERN_INTRCNT Ta "node" Ta "not applicable" 443.It Dv KERN_JOB_CONTROL Ta "integer" Ta "no" 444.It Dv KERN_MALLOCSTATS Ta "node" Ta "no" 445.It Dv KERN_MAXCLUSTERS Ta "integer" Ta "yes" 446.It Dv KERN_MAXFILES Ta "integer" Ta "yes" 447.It Dv KERN_MAXLOCKSPERUID Ta "integer" Ta "yes" 448.It Dv KERN_MAXPARTITIONS Ta "integer" Ta "no" 449.It Dv KERN_MAXPROC Ta "integer" Ta "yes" 450.It Dv KERN_MAXTHREAD Ta "integer" Ta "yes" 451.It Dv KERN_MAXVNODES Ta "integer" Ta "yes" 452.It Dv KERN_MBSTAT Ta "struct mbstat" Ta "no" 453.It Dv KERN_MSGBUF Ta "char[]" Ta "no" 454.It Dv KERN_MSGBUFSIZE Ta "integer" Ta "no" 455.It Dv KERN_NCHSTATS Ta "struct nchstats" Ta "no" 456.It Dv KERN_NFILES Ta "integer" Ta "no" 457.It Dv KERN_NGROUPS Ta "integer" Ta "no" 458.It Dv KERN_NOSUIDCOREDUMP Ta "integer" Ta "yes" 459.It Dv KERN_NPROCS Ta "integer" Ta "no" 460.It Dv KERN_NSELCOLL Ta "integer" Ta "no" 461.It Dv KERN_NTHREADS Ta "integer" Ta "no" 462.It Dv KERN_NUMVNODES Ta "integer" Ta "no" 463.It Dv KERN_OSRELEASE Ta "string" Ta "no" 464.It Dv KERN_OSREV Ta "integer" Ta "no" 465.It Dv KERN_OSTYPE Ta "string" Ta "no" 466.It Dv KERN_OSVERSION Ta "string" Ta "no" 467.It Dv KERN_PFSTATUS Ta "struct pf_status" Ta "no" 468.It Dv KERN_POOL_DEBUG Ta "integer" Ta "yes" 469.It Dv KERN_POSIX1 Ta "integer" Ta "no" 470.It Dv KERN_PROC Ta "struct kinfo_proc" Ta "no" 471.It Dv KERN_PROC_ARGS Ta "node" Ta "not applicable" 472.It Dv KERN_PROC_CWD Ta "string" Ta "not applicable" 473.It Dv KERN_PROC_NOBROADCASTKILL Ta "node" Ta "not applicable" 474.It Dv KERN_PROC_VMMAP Ta "struct kinfo_vmentry" Ta "no" 475.It Dv KERN_PROF Ta "node" Ta "not applicable" 476.It Dv KERN_RAWPARTITION Ta "integer" Ta "no" 477.It Dv KERN_SAVED_IDS Ta "integer" Ta "no" 478.It Dv KERN_SECURELVL Ta "integer" Ta "raise only" 479.It Dv KERN_SEMINFO Ta "node" Ta "not applicable" 480.It Dv KERN_SHMINFO Ta "node" Ta "not applicable" 481.It Dv KERN_SOMAXCONN Ta "integer" Ta "yes" 482.It Dv KERN_SOMINCONN Ta "integer" Ta "yes" 483.It Dv KERN_SPLASSERT Ta "int" Ta "yes" 484.It Dv KERN_STACKGAPRANDOM Ta "integer" Ta "yes" 485.It Dv KERN_SYSVIPC_INFO Ta "node" Ta "not applicable" 486.It Dv KERN_SYSVMSG Ta "integer" Ta "no" 487.It Dv KERN_SYSVSEM Ta "integer" Ta "no" 488.It Dv KERN_SYSVSHM Ta "integer" Ta "no" 489.It Dv KERN_TIMECOUNTER Ta "node" Ta "not applicable" 490.It Dv KERN_TTY Ta "node" Ta "not applicable" 491.It Dv KERN_TTYCOUNT Ta "integer" Ta "no" 492.It Dv KERN_UTC_OFFSET Ta "integer" Ta "yes" 493.It Dv KERN_VERSION Ta "string" Ta "no" 494.It Dv KERN_VIDEO Ta "node" Ta "yes" 495.It Dv KERN_WATCHDOG Ta "node" Ta "not applicable" 496.It Dv KERN_WITNESS Ta "node" Ta "not applicable" 497.It Dv KERN_WXABORT Ta "integer" Ta "yes" 498.El 499.Bl -tag -width "123456" 500.It Dv KERN_ALLOWDT Pq Va kern.allowdt 501Allow userland processes access to 502.Pa /dev/dt . 503When running with a 504.Xr securelevel 7 505greater than 0, 506this variable may not be changed. 507.It Dv KERN_ALLOWKMEM Pq Va kern.allowkmem 508Allow userland processes access to 509.Pa /dev/mem 510and 511.Pa /dev/kmem . 512When running with a 513.Xr securelevel 7 514greater than 0, 515this variable may not be changed. 516.It Dv KERN_ARGMAX Pq Va kern.argmax 517The maximum number of bytes allowed among the arguments to 518.Xr execve 2 . 519.It Dv KERN_AUDIO Pq Va kern.audio 520Control device-independent aspects of the 521.Xr audio 4 522subsystem. 523Currently, there is one subnode: 524.Bl -column "KERN_AUDIO_RECORD" "integer" "Changeable" -offset indent 525.It Sy "Third level name" Ta Sy "Type" Ta Sy "Changeable" 526.It Dv KERN_AUDIO_RECORD Ta "integer" Ta "yes" 527.El 528.Pp 529Its meaning is as follows: 530.Bl -tag -width "123456" 531.It Dv KERN_AUDIO_RECORD Pq Va kern.audio.record 532If set to the default value of 0, recording is muted by default 533for all audio devices. 534Otherwise, audio recording is enabled by default. 535For individual devices, this setting can be overridden with the 536.Xr mixerctl 8 537.Va record.enable 538variable. 539.El 540.It Dv KERN_BOOTTIME Pq Va kern.boottime 541A 542.Vt struct timeval 543structure is returned. 544This structure contains the time that the system was booted. 545.It Dv KERN_CACHEPCT Pq Va kern.bufcachepercent 546The maximum percentage of DMA-reachable physical memory the buffer cache may use. 547.It Dv KERN_CCPU Pq Va kern.ccpu 548The scheduler exponential decay value. 549.It Dv KERN_CLOCKRATE Pq Va kern.clockrate 550A 551.Vt struct clockinfo 552structure is returned. 553This structure contains the hard clock, statistics clock and profiling clock 554frequencies, and the number of microseconds per hard clock tick. 555.It Dv KERN_CONSDEV Pq Va kern.consdev 556The console device. 557.It Dv KERN_CPTIME Pq Va kern.cp_time 558An array of longs of size 559.Dv CPUSTATES 560is returned, containing statistics about the number of ticks spent by 561the system in interrupt processing, user processes 562.Po 563.Xr nice 1 564or normal 565.Pc , 566system processing, lock spinning, or idling. 567.It Dv KERN_CPTIME2 Pq Va kern.cp_time2 568Similar to 569.Dv KERN_CPTIME , 570but obtains information from only the single CPU specified by the 571third level name given. 572.It Dv KERN_CPUSTATS 573A 574.Vt struct cpustats 575structure is returned. 576This structure contains the array described in 577.Dv KERN_CPTIME2 578and a bit mask indicating the status of the CPU specified by the 579third level name. 580.It Dv KERN_DOMAINNAME Pq Va kern.domainname 581Get or set the YP domain name. 582.It Dv KERN_FILE Pq Va kern.file 583Return the entire file table, or a subset of it. 584An array of 585.Vt struct kinfo_file 586structures is returned, 587whose size depends on the current number of selected files in the system. 588The third and fourth level names are as follows: 589.Bl -column "Third level name" "Fourth level is:" -offset indent 590.It Sy "Third level name" Ta Sy "Fourth level is:" 591.It Dv KERN_FILE_BYFILE Ta "A file type" 592.It Dv KERN_FILE_BYPID Ta "A process ID" 593.It Dv KERN_FILE_BYUID Ta "A user ID" 594.El 595.Pp 596The fifth level name is the size of the 597.Vt struct kinfo_file 598and the sixth level name is the number of structures to return. 599.It Dv KERN_FORKSTAT Pq Va kern.forkstat 600A 601.Vt struct forkstat 602structure is returned. 603This structure contains information about the number of 604.Xr fork 2 , 605.Xr vfork 2 , 606and 607.Xr __tfork 3 608system calls as well as kernel thread creations since system startup, 609and the number of pages of virtual memory involved in each. 610.It Dv KERN_FSCALE Pq Va kern.fscale 611The kernel fixed-point scale factor. 612.It Dv KERN_FSYNC Pq Va kern.fsync 613Return 1 if the File Synchronisation Option is available on this system, 614otherwise 0. 615.It Dv KERN_GLOBAL_PTRACE Pq Va kern.global_ptrace 616When set to 1, permit 617.Xr ptrace 2 618to attach to any process with the appropriate privileges. 619When set to 0, processes may only attach to their own descendants. 620.It Dv KERN_HOSTID Pq Va kern.hostid 621Get or set the host ID. 622.It Dv KERN_HOSTNAME Pq Va kern.hostname 623Get or set the hostname. 624.It Dv KERN_JOB_CONTROL Pq Va kern.job_control 625Return 1 if job control is available on this system, otherwise 0. 626.It Dv KERN_MALLOCSTATS Pq Va kern.malloc 627Return kernel memory bucket statistics. 628The third level names are detailed below. 629There are no changeable values in this branch. 630.Bl -column "KERN_MALLOC_KMEMNAMES" "string" -offset indent 631.It Sy "Third level name" Ta Sy "Type" 632.It Dv KERN_MALLOC_BUCKET Ta "node" 633.It Dv KERN_MALLOC_BUCKETS Ta "string" 634.It Dv KERN_MALLOC_KMEMNAMES Ta "string" 635.It Dv KERN_MALLOC_KMEMSTATS Ta "node" 636.El 637.Pp 638The variables are as follows: 639.Bl -tag -width "123456" 640.It Dv KERN_MALLOC_BUCKET.<size> Pq Va kern.malloc.bucket 641A node containing the statistics for the memory bucket of the 642specified size (in decimal notation, the number of bytes per bucket 643element, e.g., 16, 32, 128). 644Each node returns a 645.Vt struct kmembuckets . 646.Pp 647If a value is specified that does not correspond directly to a 648bucket size, the statistics for the closest larger bucket size will be 649returned instead. 650.Pp 651Note that bucket sizes are typically powers of 2. 652.It Dv KERN_MALLOC_BUCKETS Pq Va kern.malloc.buckets 653Return a comma-separated list of the bucket sizes used by the kernel. 654.It Dv KERN_MALLOC_KMEMNAMES Pq Va kern.malloc.kmemnames 655Return a comma-separated list of the names of the kernel 656.Xr malloc 9 657types. 658.It Dv KERN_MALLOC_KMEMSTATS Pq Va kern.malloc.kmemstat 659A node containing the statistics for the memory types of the specified 660name. 661Each node returns a 662.Vt struct kmemstats . 663.El 664.It Dv KERN_MAXCLUSTERS Pq Va kern.maxclusters 665The maximum number of 666.Xr mbuf 9 667clusters that may be allocated. 668.It Dv KERN_MAXFILES Pq Va kern.maxfiles 669The maximum number of open files that may be open in the system. 670.It Dv KERN_MAXLOCKSPERUID Pq Va kern.maxlocksperuid 671The maximum number of file locks per user; 672the default is 1024. 673.It Dv KERN_MAXPARTITIONS Pq Va kern.maxpartitions 674The maximum number of partitions allowed per disk. 675.It Dv KERN_MAXPROC Pq Va kern.maxproc 676The maximum number of simultaneous processes the system will allow. 677.It Dv KERN_MAXTHREAD Pq Va kern.maxthread 678The maximum number of simultaneous threads the system will allow. 679.It Dv KERN_MAXVNODES Pq Va kern.maxvnodes 680The maximum number of vnodes available on the system. 681.It Dv KERN_MBSTAT Pq Va kern.mbstat 682A 683.Vt struct mbstat 684structure is returned, containing statistics on 685.Xr mbuf 9 686usage. 687.It Dv KERN_MSGBUF Pq Va kern.msgbuf 688Returns a buffer containing kernel log messages; 689see 690.Xr dmesg 8 . 691.It Dv KERN_MSGBUFSIZE Pq Va kern.msgbufsize 692The size of the kernel message buffer. 693.It Dv KERN_NCHSTATS Pq Va kern.nchstats 694A 695.Vt struct nchstats 696structure is returned. 697This structure contains information about the 698filename to 699.Xr inode 5 700mapping cache. 701.It Dv KERN_NFILES Pq Va kern.nfiles 702Number of open files. 703.It Dv KERN_NGROUPS Pq Va kern.ngroups 704The maximum number of supplemental groups. 705.It Dv KERN_NOSUIDCOREDUMP Pq Va kern.nosuidcoredump 706Whether a process may dump core after changing user or group ID: 707.Bl -column "value" "condition" "current directory" 708.It Sy "value" Ta Sy "condition" Ta Sy "dump core to" 709.It 0 Ta "euid == 0" Ta "current directory" 710.It 1 Ta "never" Ta "" 711.It 2 Ta "always" Ta Pa "/var/crash" 712.It 3 Ta "depends" Ta Pa "/var/crash/$programname/" 713.El 714.It Dv KERN_NPROCS Pq Va kern.nprocs 715The number of entries in the kernel process table. 716.It Dv KERN_NSELCOLL Pq Va kern.nselcoll 717Number of 718.Xr select 2 719collisions. 720.It Dv KERN_NTHREADS Pq Va kern.nthreads 721The number of entries in the kernel thread table. 722.It Dv KERN_NUMVNODES Pq Va kern.numvnodes 723Number of vnodes in use. 724.It Dv KERN_OSRELEASE Pq Va kern.osrelease 725The system release string. 726.It Dv KERN_OSREV Pq Va kern.osrevision 727The system revision number. 728.It Dv KERN_OSTYPE Pq Va kern.ostype 729The system type string. 730.It Dv KERN_OSVERSION Pq Va kern.osversion 731The kernel build version. 732.It Dv KERN_PFSTATUS 733The 734.Vt struct pf_status 735structure. 736.It Dv KERN_POOL_DEBUG Pq Va kern.pool_debug 737Modify the memory pool debug level. 738Valid values are: 739.Pp 740.Bl -tag -width 3n -offset indent -compact 741.It 0 742Disable pool debugging. 743.It 1 744Enable use after free detection. 745.It 2 746In addition to 1, when calling either 747.Xr malloc 9 748or 749.Xr pool_get 9 750with flags indicating that sleeping is allowed then always yield. 751Useful to detect potential races. 752.El 753.It Dv KERN_POSIX1 Pq Va kern.posix1version 754The version of ISO/IEC 9945 (POSIX 1003.1) with which the system 755attempts to comply. 756.It Dv KERN_PROC Pq Va kern.proc 757Return the entire process table, or a subset of it. 758An array of 759.Vt struct kinfo_proc 760structures is returned, 761whose size depends on the current number of selected processes in the system. 762The third and fourth level names are as follows: 763.Bl -column "KERN_PROC_SESSION" "Fourth level is:" -offset indent 764.It Sy "Third level name" Ta Sy "Fourth level is:" 765.It Dv KERN_PROC_ALL Ta "None" 766.It Dv KERN_PROC_KTHREAD Ta "A kernel thread" 767.It Dv KERN_PROC_PID Ta "A process ID" 768.It Dv KERN_PROC_PGRP Ta "A process group" 769.It Dv KERN_PROC_RUID Ta "A real user ID" 770.It Dv KERN_PROC_SESSION Ta "A session PID" 771.It Dv KERN_PROC_TTY Ta "A tty device" 772.It Dv KERN_PROC_UID Ta "A user ID" 773.El 774.Pp 775The fifth level name is the size of the 776.Vt struct kinfo_proc 777and the sixth level name is the number of structures to return. 778.It Dv KERN_PROC_ARGS Pq Va kern.procargs 779Returns the arguments or environment of a process. 780The third level name is the PID of the process. 781The fourth level name is one of: 782.Bl -column KERN_PROC_NARGV -offset indent 783.It Dv KERN_PROC_ARGV 784.It Dv KERN_PROC_ENV 785.It Dv KERN_PROC_NARGV 786.It Dv KERN_PROC_NENV 787.El 788.Pp 789.Dv KERN_PROC_NARGV 790and 791.Dv KERN_PROC_NENV 792return the number of elements as an 793.Vt int 794in the argv or env array. 795.Dv KERN_PROC_ARGV 796returns the argv array and 797.Dv KERN_PROC_ENV 798returns the environ array. 799The buffer pointed to by 800.Fa oldp 801is filled with an array of char pointers 802followed by the strings themselves. 803The last char pointer is a 804.Dv NULL 805pointer. 806.It Dv KERN_PROC_CWD Pq Va kern.proc_cwd 807Return the current working directory of a process. 808The third level name is the target process ID. 809A NUL-terminated string is returned. 810.It Dv KERN_PROC_NOBROADCASTKILL Pq Va kern.proc_nobroadcastkill 811When set, a process will no longer be signaled when sending broadcast signals. 812The third level name is the target process ID. 813.It Dv KERN_PROC_VMMAP Pq Va kern.proc_vmmap 814Return the entire process VM map entries. 815An array of 816.Vt struct kinfo_vmentry 817structures is returned, 818whose size depends on the current number of VM map entries of the selected process. 819Iteration is possible by setting the base address in the first element of 820.Vt struct kinfo_vmentry . 821.It Dv KERN_PROF Pq Va kern.profiling 822Return profiling information about the kernel. 823If the kernel is not compiled for profiling, 824attempts to retrieve any of the 825.Dv KERN_PROF 826values will fail with 827.Er EOPNOTSUPP . 828The third level names for the string and integer profiling information 829are detailed below. 830The changeable column shows whether a process with appropriate 831privileges may change the value. 832.Bl -column "Third level name" "struct gmonparam" -offset indent 833.It Sy "Third level name" Ta Sy "Type" Ta Sy "Changeable" 834.It Dv GPROF_COUNT Ta "u_short[]" Ta "yes" 835.It Dv GPROF_FROMS Ta "u_short[]" Ta "yes" 836.It Dv GPROF_GMONPARAM Ta "struct gmonparam" Ta "no" 837.It Dv GPROF_STATE Ta "integer" Ta "yes" 838.It Dv GPROF_TOS Ta "struct tostruct" Ta "yes" 839.El 840.Pp 841The variables are as follows: 842.Bl -tag -width "123456" 843.It Dv GPROF_COUNT 844Array of statistical program counter counts. 845.It Dv GPROF_FROMS 846Array indexed by program counter of call-from points. 847.It Dv GPROF_GMONPARAM 848Structure giving the sizes of the above arrays. 849.It Dv GPROF_STATE 850Returns 851.Dv GMON_PROF_ON 852or 853.Dv GMON_PROF_OFF 854to show that profiling is running or stopped. 855.It Dv GPROF_TOS 856Array of 857.Vt struct tostruct 858describing destination of calls and their counts. 859.El 860.It Dv KERN_RAWPARTITION Pq Va kern.rawpartition 861The raw partition of a disk (a == 0). 862.It Dv KERN_SAVED_IDS Pq Va kern.saved_ids 863Returns 1 if saved set-group-ID and saved set-user-ID are available. 864.It Dv KERN_SECURELVL Pq Va kern.securelevel 865The system security level. 866This level may be raised by processes with appropriate privileges. 867It may only be lowered by process 1. 868.It Dv KERN_SEMINFO Pq Va kern.seminfo 869Return the elements of 870.Vt struct seminfo . 871If the kernel is not compiled with System V style semaphore support, 872attempts to retrieve any of the 873.Dv KERN_SEMINFO 874values will fail with 875.Er EOPNOTSUPP . 876The third level names for the elements of 877.Vt struct seminfo 878are detailed below. 879The changeable column shows whether a process with appropriate 880privileges may change the value. 881.Bl -column "KERN_SEMINFO_SEMMNI" "integer" "Changeable" -offset indent 882.It Sy "Third level name" Ta Sy "Type" Ta Sy "Changeable" 883.It Dv KERN_SEMINFO_SEMAEM Ta "integer" Ta "no" 884.It Dv KERN_SEMINFO_SEMMNI Ta "integer" Ta "yes" 885.It Dv KERN_SEMINFO_SEMMNS Ta "integer" Ta "yes" 886.It Dv KERN_SEMINFO_SEMMNU Ta "integer" Ta "yes" 887.It Dv KERN_SEMINFO_SEMMSL Ta "integer" Ta "yes" 888.It Dv KERN_SEMINFO_SEMOPM Ta "integer" Ta "yes" 889.It Dv KERN_SEMINFO_SEMUME Ta "integer" Ta "no" 890.It Dv KERN_SEMINFO_SEMUSZ Ta "integer" Ta "no" 891.It Dv KERN_SEMINFO_SEMVMX Ta "integer" Ta "no" 892.El 893.Pp 894The variables are as follows: 895.Bl -tag -width "123456" 896.It Dv KERN_SEMINFO_SEMAEM Pq Va kern.seminfo.semaem 897The adjust on exit maximum value. 898.It Dv KERN_SEMINFO_SEMMNI Pq Va kern.seminfo.semmni 899The maximum number of semaphore identifiers allowed. 900.It Dv KERN_SEMINFO_SEMMNS Pq Va kern.seminfo.semmns 901The maximum number of semaphores allowed in the system. 902.It Dv KERN_SEMINFO_SEMMNU Pq Va kern.seminfo.semmnu 903The maximum number of semaphore undo structures allowed in the system. 904.It Dv KERN_SEMINFO_SEMMSL Pq Va kern.seminfo.semmsl 905The maximum number of semaphores allowed per ID. 906.It Dv KERN_SEMINFO_SEMOPM Pq Va kern.seminfo.semopm 907The maximum number of operations per 908.Xr semop 2 909call. 910.It Dv KERN_SEMINFO_SEMUME Pq Va kern.seminfo.semume 911The maximum number of undo entries per process. 912.It Dv KERN_SEMINFO_SEMUSZ Pq Va kern.seminfo.semusz 913The size (in bytes) of the undo structure. 914.It Dv KERN_SEMINFO_SEMVMX Pq Va kern.seminfo.semvmx 915The semaphore maximum value. 916.El 917.It Dv KERN_SHMINFO Pq Va kern.shminfo 918Return the elements of 919.Vt struct shminfo . 920If the kernel is not compiled with System V style shared memory support, 921attempts to retrieve any of the 922.Dv KERN_SHMINFO 923values will fail with 924.Er EOPNOTSUPP . 925The third level names for the elements of 926.Vt struct shminfo 927are detailed below. 928The changeable column shows whether a process with appropriate 929privileges may change the value. 930.Bl -column "KERN_SHMINFO_SHMMAX" "integer" "Changeable" -offset indent 931.It Sy "Third level name" Ta Sy "Type" Ta Sy "Changeable" 932.It Dv KERN_SHMINFO_SHMALL Ta "integer" Ta "yes" 933.It Dv KERN_SHMINFO_SHMMAX Ta "integer" Ta "yes" 934.It Dv KERN_SHMINFO_SHMMIN Ta "integer" Ta "yes" 935.It Dv KERN_SHMINFO_SHMMNI Ta "integer" Ta "yes" 936.It Dv KERN_SHMINFO_SHMSEG Ta "integer" Ta "yes" 937.El 938.Pp 939The variables are as follows: 940.Bl -tag -width "123456" 941.It Dv KERN_SHMINFO_SHMALL Pq Va kern.shminfo.shmall 942The maximum amount of total shared memory allowed in the system (in pages). 943.It Dv KERN_SHMINFO_SHMMAX Pq Va kern.shminfo.shmmax 944The maximum shared memory segment size (in bytes). 945.It Dv KERN_SHMINFO_SHMMIN Pq Va kern.shminfo.shmmin 946The minimum shared memory segment size (in bytes). 947.It Dv KERN_SHMINFO_SHMMNI Pq Va kern.shminfo.shmmni 948The maximum number of shared memory identifiers in the system. 949.It Dv KERN_SHMINFO_SHMSEG Pq Va kern.shminfo.shmseg 950The maximum number of shared memory segments per process. 951.El 952.It Dv KERN_SOMAXCONN Pq Va kern.somaxconn 953Upper bound on the number of half-open connections a process can allow 954to be associated with a socket, using 955.Xr listen 2 . 956The default value is 128. 957.It Dv KERN_SOMINCONN Pq Va kern.sominconn 958Lower bound on the number of half-open connections a process can allow 959to be associated with a socket, using 960.Xr listen 2 . 961The default value is 80. 962.It Dv KERN_SPLASSERT Pq Va kern.splassert 963Modify the system interrupt priority level. 964Valid values are: 965.Pp 966.Bl -tag -width 3n -offset indent -compact 967.It 0 968Disable error checking. 969.It 1 970Print a message if an error is detected. 971.It 2 972Print a message if an error is detected, 973and a stack trace if possible. 974.It 3 975The same as 2, but also drop into the kernel debugger. 976.El 977.Pp 978Any other value causes a system panic on errors. 979See 980.Xr splassert 9 981for more information. 982.It Dv KERN_STACKGAPRANDOM Pq Va kern.stackgap_random 983Sets the range of the random value added to the stack pointer on each 984program execution. 985The random value is added to make buffer overflow exploitation slightly 986harder. 987The bigger the number, the harder it is to brute force this added protection, 988but it also means bigger waste of memory. 989.It Dv KERN_SYSVIPC_INFO Pq Va kern.sysvipc_info 990Return System V style IPC configuration and run-time information. 991The third level name selects the System V style IPC facility. 992.Bl -column "KERN_SYSVIPC_MSG_INFO" "struct shm_sysctl_info" -offset indent 993.It Sy "Third level name" Ta Sy "Type" 994.It Dv KERN_SYSVIPC_MSG_INFO Ta "struct msg_sysctl_info" 995.It Dv KERN_SYSVIPC_SEM_INFO Ta "struct sem_sysctl_info" 996.It Dv KERN_SYSVIPC_SHM_INFO Ta "struct shm_sysctl_info" 997.El 998.Bl -tag -width "123456" 999.It Dv KERN_SYSVIPC_MSG_INFO 1000Return information on the System V style message facility. 1001The 1002.Sy msg_sysctl_info 1003structure is defined in 1004.In sys/msg.h . 1005.It Dv KERN_SYSVIPC_SEM_INFO 1006Return information on the System V style semaphore facility. 1007The 1008.Sy sem_sysctl_info 1009structure is defined in 1010.In sys/sem.h . 1011.It Dv KERN_SYSVIPC_SHM_INFO 1012Return information on the System V style shared memory facility. 1013The 1014.Sy shm_sysctl_info 1015structure is defined in 1016.In sys/shm.h . 1017.El 1018.It Dv KERN_SYSVMSG Pq Va kern.sysvmsg 1019Returns 1 if System V style message queue functionality is available on this 1020system, otherwise 0. 1021.It Dv KERN_SYSVSEM Pq Va kern.sysvem 1022Returns 1 if System V style semaphore functionality is available on this 1023system, otherwise 0. 1024.It Dv KERN_SYSVSHM Pq Va kern.sysvshm 1025Returns 1 if System V style shared memory functionality is available on this 1026system, otherwise 0. 1027.It Dv KERN_TIMECOUNTER Pq Va kern.timecounter 1028Return statistics information about the kernel time counter. 1029The third level names information is detailed below. 1030The changeable column shows whether a process with appropriate 1031privileges may change the value. 1032.Bl -column "KERN_TIMECOUNTER_TIMESTEPWARNINGS" "integer" -offset indent 1033.It Sy "Third level name" Ta Sy "Type" Ta Sy "Changeable" 1034.It Dv KERN_TIMECOUNTER_CHOICE Ta "string" Ta "no" 1035.It Dv KERN_TIMECOUNTER_HARDWARE Ta "string" Ta "yes" 1036.It Dv KERN_TIMECOUNTER_TICK Ta "integer" Ta "no" 1037.It Dv KERN_TIMECOUNTER_TIMESTEPWARNINGS Ta "integer" Ta "yes" 1038.El 1039.Pp 1040The variables are as follows: 1041.Bl -tag -width "123456" 1042.It Dv KERN_TIMECOUNTER_CHOICE Pq Va kern.timecounter.choice 1043Get the list of kernel time counter sources and their claimed 1044quality (higher is better). 1045.It Dv KERN_TIMECOUNTER_HARDWARE Pq Va kern.timecounter.hardware 1046Get or set the kernel time counter source by name. 1047.It Dv KERN_TIMECOUNTER_TICK Pq Va kern.timecounter.tick 1048Get the number of times we have reset the kernel time counter 1049information. 1050.It Dv KERN_TIMECOUNTER_TIMESTEPWARNINGS Pq Va kern.timecounter.timestepwarnings 1051Get or set a flag to log a message when the kernel time is 1052stepped. 1053.El 1054.It Dv KERN_TTY Pq Va kern.tty 1055Return statistics information about tty input/output. 1056The third level names information is detailed below. 1057The changeable column shows whether a process with appropriate 1058privileges may change the value. 1059.Bl -column "KERN_TTY_TKRAWCC" "struct itty" "Changeable" -offset indent 1060.It Sy "Third level name" Ta Sy "Type" Ta Sy "Changeable" 1061.It Dv KERN_TTY_INFO Ta "struct itty" Ta "no" 1062.It Dv KERN_TTY_TKCANCC Ta "int64_t" Ta "no" 1063.It Dv KERN_TTY_TKNIN Ta "int64_t" Ta "no" 1064.It Dv KERN_TTY_TKNOUT Ta "int64_t" Ta "no" 1065.It Dv KERN_TTY_TKRAWCC Ta "int64_t" Ta "no" 1066.El 1067.Pp 1068The variables are as follows: 1069.Bl -tag -width "123456" 1070.It Dv KERN_TTY_INFO Pq Va kern.tty.ttyinfo 1071Returns an array of 1072.Vt struct itty 1073structures containing tty statistics. 1074.It Dv KERN_TTY_TKCANCC Pq Va kern.tty.tk_cancc 1075Returns the number of input characters in canonical mode. 1076.It Dv KERN_TTY_TKNIN Pq Va kern.tty.tk_nin 1077Returns the number of input characters from a 1078.Xr tty 4 . 1079.It Dv KERN_TTY_TKNOUT Pq Va kern.tty.tk_nout 1080Returns the number of output characters on a 1081.Xr tty 4 . 1082.It Dv KERN_TTY_TKRAWCC Pq Va kern.tty.tk_rawcc 1083Returns the number of input characters in raw mode. 1084.El 1085.It Dv KERN_TTYCOUNT Pq Va kern.ttycount 1086Number of available 1087.Xr tty 4 1088devices. 1089.It Dv KERN_UTC_OFFSET Pq Va kern.utc_offset 1090The real-time clock's 1091.Pq RTC 1092offset from 1093Coordinated Universal Time 1094.Pq UTC 1095expressed as minutes East of UTC+0. 1096When set, 1097time read from the RTC is adjusted to remove the offset 1098and time written to the RTC is adjusted to reapply it. 1099This may simplify multibooting with an operating system that 1100does not run the RTC in UTC mode. 1101When running with a 1102.Xr securelevel 7 1103greater than 0, 1104this variable may not be changed. 1105.It Dv KERN_VERSION Pq Va kern.version 1106The system version string. 1107.It Dv KERN_VIDEO Pq Va kern.video 1108Control device-independent aspects of the 1109.Xr video 4 1110subsystem. 1111Currently, there is one subnode: 1112.Bl -column "KERN_VIDEO_RECORD" "integer" "Changeable" -offset indent 1113.It Sy "Third level name" Ta Sy "Type" Ta Sy "Changeable" 1114.It Dv KERN_VIDEO_RECORD Ta "integer" Ta "yes" 1115.El 1116.Pp 1117Its meaning is as follows: 1118.Bl -tag -width "123456" 1119.It Dv KERN_VIDEO_RECORD Pq Va kern.video.record 1120If set to the default value of 0, recording is blanked for all video devices. 1121If the value is non-zero, video recording is enabled. 1122.El 1123.It Dv KERN_WATCHDOG Pq Va kern.watchdog 1124Return information on hardware watchdog timers. 1125If the kernel does not support a hardware watchdog timer, 1126attempts to retrieve or set any of the 1127.Dv KERN_WATCHDOG 1128values will fail with 1129.Er EOPNOTSUPP . 1130.Bl -column "KERN_WATCHDOG_PERIOD" "integer" "Changeable" -offset indent 1131.It Sy "Third level name" Ta Sy "Type" Ta Sy "Changeable" 1132.It Dv KERN_WATCHDOG_AUTO Ta "integer" Ta "yes" 1133.It Dv KERN_WATCHDOG_PERIOD Ta "integer" Ta "yes" 1134.El 1135.Pp 1136The variables are as follows: 1137.Bl -tag -width "123456" 1138.It Dv KERN_WATCHDOG_AUTO Pq Va kern.watchdog.auto 1139If set to 1, the kernel refreshes the watchdog timer periodically. 1140If set to 0, a userland process must ensure that the watchdog timer 1141gets refreshed by setting the 1142.Dv KERN_WATCHDOG_PERIOD 1143variable. 1144.It Dv KERN_WATCHDOG_PERIOD Pq Va kern.watchdog.period 1145The period of the watchdog timer in seconds. 1146Set to 0 to disable the watchdog timer. 1147.El 1148.It Dv KERN_WITNESS Pq Va kern.witness 1149Control settings of 1150.Xr witness 4 . 1151.Bl -column "KERN_WITNESS_LOCKTRACE" "integer" "Changeable" -offset indent 1152.It Sy "Third level name" Ta Sy "Type" Ta Sy "Changeable" 1153.It Dv KERN_WITNESS_LOCKTRACE Ta "integer" Ta "yes" 1154.It Dv KERN_WITNESS_WATCH Ta "integer" Ta "yes" 1155.El 1156.Pp 1157The variables are as follows: 1158.Bl -tag -width "123456" 1159.It Dv KERN_WITNESS_LOCKTRACE Pq Va kern.witness.locktrace 1160When set, 1161.Xr witness 4 1162saves a stack trace on each lock acquisition. 1163The stack traces of acquired locks can be viewed using 1164.Xr ddb 4 . 1165.It Dv KERN_WITNESS_WATCH Pq Va kern.witness.watch 1166Control how 1167.Xr witness 4 1168behaves on error. 1169Valid values are: 1170.Pp 1171.Bl -tag -width 3n -offset indent -compact 1172.It -1 1173Disable 1174.Xr witness 4 1175completely. 1176System reboot is needed to re-enable it. 1177.It 0 1178Disable lock order checking. 1179.It 1 1180Print a message if an error is detected. 1181.It 2 1182Print a message if an error is detected, 1183and a stack trace if possible. 1184.It 3 1185The same as 2, but also drop into the kernel debugger. 1186.El 1187.El 1188.It Dv KERN_WXABORT Pq Va kern.wxabort 1189Generate an abort, 1190rather than returning an error, 1191on W^X violation. 1192.El 1193.Ss CTL_MACHDEP 1194The set of variables defined is architecture dependent. 1195Most architectures define at least the following variables. 1196.Bl -column "Second level name" "dev_t" "Changeable" -offset indent 1197.It Sy "Second level name" Ta Sy "Type" Ta Sy "Changeable" 1198.It Dv CPU_CONSDEV Ta "dev_t" Ta "no" 1199.El 1200.Pp 1201Consult the example file 1202.Pa /etc/examples/sysctl.conf 1203for a non-exhaustive list of 1204.Va machdep 1205variables. 1206.Ss CTL_NET 1207The string and integer information available for the 1208.Dv CTL_NET 1209level is detailed below. 1210The changeable column shows whether a process with appropriate 1211privileges may change the value. 1212.Bl -column "Second level name" "routing messages" "Changeable" -offset indent 1213.It Sy "Second level name" Ta Sy "Type" Ta Sy "Changeable" 1214.It Dv PF_ROUTE Ta "routing messages" Ta "no" 1215.It Dv PF_INET Ta "IPv4 values" Ta "yes" 1216.It Dv PF_INET6 Ta "IPv6 values" Ta "yes" 1217.It Dv PF_UNIX Ta "UNIX-domain values" Ta "yes" 1218.It Dv PF_KEY Ta "key management" Ta "no" 1219.It Dv PF_MPLS Ta "MPLS values" Ta "yes" 1220.It Dv PF_PIPEX Ta "PIPEX values" Ta "yes" 1221.El 1222.Bl -tag -width "123456" 1223.It Dv PF_ROUTE 1224Return the entire routing table or a subset of it. 1225The data is returned as a sequence of routing messages (see 1226.Xr route 4 1227for the header file, format, and meaning). 1228The length of each message is contained in the message header. 1229.Pp 1230The third level name is a protocol number, which is currently always 0. 1231The fourth level name is an address family, which may be set to 0 to 1232select all address families. 1233The fifth and sixth level names are as follows: 1234.Bl -column "Fifth level name" "Sixth level is:" -offset indent 1235.It Sy "Fifth level name" Ta Sy "Sixth level is:" 1236.It Dv NET_RT_DUMP Ta "priority" 1237.It Dv NET_RT_FLAGS Ta "rtflags" 1238.It Dv NET_RT_IFLIST Ta "None" 1239.It Dv NET_RT_IFNAMES Ta "None" 1240.It Dv NET_RT_STATS Ta "None" 1241.It Dv NET_RT_TABLE Ta "rtableid" 1242.El 1243.Bl -tag -width "123456" 1244.It Dv NET_RT_DUMP 1245If set to 0, show all routes. 1246If set to any number, show all routes with that number priority. 1247If set to a negative number, show routes that do not have the positive 1248priority value. 1249.El 1250.Pp 1251An optional seventh level name can be provided to select the routing table 1252on which to run the operation. 1253If not provided, the table with ID 0 is used. 1254.It Dv PF_INET 1255Get or set various global information about IPv4 1256.Pq Internet Protocol version 4 . 1257The third level name is the protocol. 1258The fourth level name is the variable name. 1259The currently defined protocols and names are: 1260.Bl -column "Protocol name" "ipsec-expire-acquire" "structure" "Changeable" -offset 2n 1261.It Sy "Protocol name" Ta Sy "Variable name" Ta Sy "Type" Ta Sy "Changeable" 1262.It ah Ta enable Ta integer Ta yes 1263.It bpf Ta bufsize Ta integer Ta yes 1264.It bpf Ta maxbufsize Ta integer Ta yes 1265.It carp Ta allow Ta integer Ta yes 1266.It carp Ta log Ta integer Ta yes 1267.It carp Ta preempt Ta integer Ta yes 1268.It divert Ta recvspace Ta integer Ta yes 1269.It divert Ta sendspace Ta integer Ta yes 1270.It esp Ta enable Ta integer Ta yes 1271.It esp Ta udpencap Ta integer Ta yes 1272.It esp Ta udpencap_port Ta integer Ta yes 1273.It etherip Ta allow Ta integer Ta yes 1274.It gre Ta allow Ta integer Ta yes 1275.It gre Ta wccp Ta integer Ta yes 1276.It icmp Ta bmcastecho Ta integer Ta yes 1277.It icmp Ta errppslimit Ta integer Ta yes 1278.It icmp Ta maskrepl Ta integer Ta yes 1279.It icmp Ta rediraccept Ta integer Ta yes 1280.It icmp Ta redirtimeout Ta integer Ta yes 1281.It icmp Ta stats Ta structure Ta no 1282.It icmp Ta tstamprepl Ta integer Ta yes 1283.It ip Ta arpqueued Ta integer Ta no 1284.It ip Ta arpdown Ta integer Ta yes 1285.It ip Ta arptimeout Ta integer Ta yes 1286.It ip Ta arpq Ta node Ta "N/A" 1287.It ip Ta directed-broadcast Ta integer Ta yes 1288.It ip Ta encdebug Ta integer Ta yes 1289.It ip Ta forwarding Ta integer Ta yes 1290.It ip Ta ipsec-allocs Ta integer Ta yes 1291.It ip Ta ipsec-auth-alg Ta string Ta yes 1292.It ip Ta ipsec-bytes Ta integer Ta yes 1293.It ip Ta ipsec-comp-alg Ta string Ta yes 1294.It ip Ta ipsec-enc-alg Ta string Ta yes 1295.It ip Ta ipsec-expire-acquire Ta integer Ta yes 1296.It ip Ta ipsec-firstuse Ta integer Ta yes 1297.It ip Ta ipsec-invalid-life Ta integer Ta yes 1298.It ip Ta ipsec-pfs Ta integer Ta yes 1299.It ip Ta ipsec-soft-allocs Ta integer Ta yes 1300.It ip Ta ipsec-soft-bytes Ta integer Ta yes 1301.It ip Ta ipsec-soft-firstuse Ta integer Ta yes 1302.It ip Ta ipsec-soft-timeout Ta integer Ta yes 1303.It ip Ta ipsec-timeout Ta integer Ta yes 1304.It ip Ta maxqueue Ta integer Ta yes 1305.It ip Ta mforwarding Ta integer Ta yes 1306.It ip Ta mtudisc Ta integer Ta yes 1307.It ip Ta mtudisctimeout Ta integer Ta yes 1308.It ip Ta multipath Ta integer Ta yes 1309.It ip Ta portfirst Ta integer Ta yes 1310.It ip Ta porthifirst Ta integer Ta yes 1311.It ip Ta porthilast Ta integer Ta yes 1312.It ip Ta portlast Ta integer Ta yes 1313.It ip Ta redirect Ta integer Ta yes 1314.It ip Ta sourceroute Ta integer Ta yes 1315.It ip Ta stats Ta structure Ta no 1316.It ip Ta ttl Ta integer Ta yes 1317.It ipcomp Ta enable Ta integer Ta yes 1318.It ipip Ta allow Ta integer Ta yes 1319.It tcp Ta ackonpush Ta integer Ta yes 1320.It tcp Ta always_keepalive Ta integer Ta yes 1321.It tcp Ta baddynamic Ta array Ta yes 1322.It tcp Ta ecn Ta integer Ta yes 1323.It tcp Ta ident Ta structure Ta no 1324.It tcp Ta keepidle Ta integer Ta yes 1325.It tcp Ta keepinittime Ta integer Ta yes 1326.It tcp Ta keepintvl Ta integer Ta yes 1327.It tcp Ta mssdflt Ta integer Ta yes 1328.It tcp Ta reasslimit Ta integer Ta yes 1329.It tcp Ta rfc1323 Ta integer Ta yes 1330.It tcp Ta rfc3390 Ta integer Ta yes 1331.It tcp Ta rootonly Ta array Ta yes 1332.It tcp Ta rstppslimit Ta integer Ta yes 1333.It tcp Ta sack Ta integer Ta yes 1334.It tcp Ta slowhz Ta integer Ta no 1335.It tcp Ta stats Ta structure Ta no 1336.It tcp Ta synbucketlimit Ta integer Ta yes 1337.It tcp Ta syncachelimit Ta integer Ta yes 1338.It tcp Ta synhashsize Ta integer Ta yes 1339.It tcp Ta synuselimit Ta integer Ta yes 1340.It udp Ta baddynamic Ta array Ta yes 1341.It udp Ta checksum Ta integer Ta yes 1342.It udp Ta recvspace Ta integer Ta yes 1343.It udp Ta rootonly Ta array Ta yes 1344.It udp Ta sendspace Ta integer Ta yes 1345.It udp Ta stats Ta structure Ta no 1346.El 1347.Pp 1348The variables are as follows: 1349.Bl -tag -width "123456" 1350.It Li ah.enable Pq Va net.inet.ah.enable 1351If set to 1, enable the Authentication Header 1352.Pq AH 1353IPsec protocol. 1354Enabled by default. 1355See 1356.Xr ipsec 4 1357for more information. 1358.It Li bpf.bufsize Pq Va net.bpf.bufsize 1359The initial size of 1360.Xr bpf 4 1361buffers. 1362.It Li bpf.maxbufsize Pq Va net.bpf.maxbufsize 1363The maximum size a user may request a 1364.Xr bpf 4 1365buffer to be. 1366.It Li carp.allow Pq Va net.inet.carp.allow 1367If set to 0, incoming 1368.Xr carp 4 1369packets will not be processed. 1370If set to any other value, processing will occur. 1371Enabled by default. 1372.It Li carp.log Pq Va net.inet.carp.log 1373Controls the verbosity of 1374.Xr carp 4 1375logging. 1376May be a value between 0 and 7 corresponding with 1377.Xr syslog 3 1378priorities. 1379The default value is 2. 1380.It Li carp.preempt Pq Va net.inet.carp.preempt 1381If set to 0, 1382.Xr carp 4 1383will not attempt to become master if it is receiving advertisements from 1384another active master. 1385If set to any other value, carp will become master of the virtual host if it 1386believes it can send advertisements more frequently than the current master. 1387Disabled by default. 1388.It Li divert.recvspace Pq Va net.inet.divert.recvspace 1389Returns the default divert receive buffer size. 1390.It Li divert.sendspace Pq Va net.inet.divert.sendspace 1391Returns the default divert send buffer size. 1392.It Li esp.enable Pq Va net.inet.esp.enable 1393If set to 1, enable the Encapsulating Security Payload 1394.Pq ESP 1395IPsec protocol. 1396Enabled by default. 1397See 1398.Xr ipsec 4 1399for more information. 1400.It Li esp.udpencap Pq Va net.inet.esp.udpencap 1401If set to 1, enable processing of UDP encapsulated ESP packets. 1402Enabled by default. 1403.It Li esp.udpencap_port Pq Va net.inet.udpencap_port 1404Contains the value of the UDP port that triggers 1405decapsulation for incoming UDP encapsulated ESP packets. 1406The default port is 4500. 1407.It Li etherip.allow Pq Va net.inet.etherip.allow 1408If set to 0, incoming Ethernet-in-IPv4 packets will not be processed. 1409If set to any other value, processing will occur. 1410.It Li gre.allow Pq Va net.inet.gre.allow 1411If set to 0, incoming GRE packets will not be processed. 1412If set to any other value, processing will occur. 1413.It Li gre.wccp Pq Va net.inet.gre.wccp 1414If set to 0, incoming WCCPv1-style GRE packets will not be processed. 1415If set to any other value, and gre.allow allows GRE packet processing, 1416WCCPv1-style GRE packets will be processed. 1417.It Li icmp.bmcastecho Pq Va net.inet.icmp.bmcastecho 1418If set to 1, respond to ICMP echo requests destined for 1419broadcast and multicast addresses. 1420Note, enabling this could open a system to a type of denial of service attack 1421called 1422.Qq smurfing , 1423and is thus not advised. 1424.It Li icmp.errppslimit Pq Va net.inet.icmp.errppslimit 1425This variable specifies the maximum number of outgoing ICMP error messages 1426per second. 1427ICMP error messages exceeding this value are subject to rate limitation 1428and will not go out from the node. 1429A negative value disables rate limitation. 1430.It Li icmp.maskrepl Pq Va kern.inet.icmp.maskrepl 1431Returns 1 if ICMP network mask requests are to be answered. 1432.It Li icmp.rediraccept Pq Va kern.inet.icmp.rediraccept 1433If set to non-zero, the host will accept ICMP redirect packets. 1434Note that routers will never accept ICMP redirect packets, 1435and the variable is meaningful on IP hosts only. 1436.It Li icmp.redirtimeout Pq Va net.inet.icmp.redrttimeout 1437This variable specifies the lifetime of routing entries generated by incoming 1438ICMP redirects. 1439The default timeout is 10 minutes. 1440.It Li icmp.stats Pq Va kern.inet.icmp.stats 1441Returns the ICMP statistics in a struct icmpstat. 1442.It Li icmp.tstamprepl Pq Va net.inet.icmp.tstamprepl 1443If set to 1, reply to ICMP timestamp requests. 1444If set to 0, ignore timestamp requests. 1445.It Li ip.arpqueued Pq Va net.inet.ip.arpqueued 1446Number of packets ARP resolution is holding onto until it gets a MAC 1447address for an IP. 1448.It Li ip.arpdown Pq Va net.inet.ip.arpdown 1449Lifetime of unresolved ARP entries, in seconds. 1450.It Li ip.arptimeout Pq Va net.inet.ip.arptimeout 1451Lifetime of resolved ARP entries, in seconds. 1452.It Li ip.arpq 1453Fifth level comprises an array of 1454.Vt struct ifqueue 1455structures containing information about ARP queue. 1456The fifth level names for the elements of 1457.Vt struct ifqueue 1458are detailed below. 1459.Bl -column "Fifth level name" "integer" "Changeable" -offset indent 1460.It Sy "Fifth level name" Ta Sy "Type" Ta Sy "Changeable" 1461.It Dv IFQCTL_DROPS Ta "integer" Ta "no" 1462.It Dv IFQCTL_LEN Ta "integer" Ta "no" 1463.It Dv IFQCTL_MAXLEN Ta "integer" Ta "yes" 1464.El 1465.Pp 1466The variables are as follows: 1467.Pp 1468.Bl -tag -width Ds -compact 1469.It Dv IFQCTL_DROPS Pq Va net.inet.ip.arpq.drops 1470Returns number of packet dropped. 1471.It Dv IFQCTL_LEN Pq Va net.inet.ip.arpq.len 1472Returns the current queue length. 1473.It Dv IFQCTL_MAXLEN Pq Va net.inet.ip.arpq.maxlen 1474Get or set the maximum number of queue length. 1475.El 1476.It Li ip.directed-broadcast Pq Va net.inet.ip.directed-broadcast 1477Returns 1 if directed broadcast behavior is enabled for the host. 1478.It Li ip.encdebug Pq Va net.inet.ip.encdebug 1479Returns 1 when error message reporting is enabled for the host. 1480If the kernel has been compiled with the 1481.Dv ENCDEBUG 1482option, 1483then debugging information will also be reported when this variable is set. 1484.It Li ip.forwarding Pq Va net.inet.ip.forwarding 1485If set to 0, IP forwarding is disabled. 1486The IP stack also requires the destination IP address of incoming packets 1487to match the IP address of the network interface the packet is bound to. 1488If set to 1, IP forwarding is enabled for the host, 1489indicating the host is acting as a router. 1490If set to 2, IP forwarding is restricted to traffic that has been 1491IPsec encapsulated or decapsulated by the host. 1492Enabling packet forwarding (values either 1 or 2) relaxes the requirements 1493on incoming packets, so that its destination address must match just any IP address 1494bound to the host. 1495The default value is 0. 1496.It Li ip.ipsec-allocs Pq Va net.inet.ip.ipsec-allocs 1497The number of IPsec flows that can use a security association before 1498it expires. 1499If set to less than or equal to zero, the security association will not 1500expire because of this counter. 1501The default value is 0. 1502.It Li ip.ipsec-auth-alg Pq Va net.inet.ip.ipsec-auth-alg 1503This is the default authentication algorithm the kernel will instruct 1504key management daemons to negotiate when establishing security 1505associations on behalf of the kernel. 1506Such security associations can occur as a result of a process having 1507requested some security level through 1508.Xr setsockopt 2 , 1509or as a result of dynamic VPN entries. 1510Supported values are hmac-md5, hmac-sha1, and hmac-ripemd160. 1511If set to any other value, it is left to the key management daemons to 1512select an authentication algorithm for the security association. 1513The default value is hmac-sha1. 1514.It Li ip.ipsec-bytes Pq Va net.inet.ip.ipsec-bytes 1515The number of bytes that will be processed by a security association 1516before it expires. 1517If set to less than or equal to zero, the security association will not 1518expire because of this counter. 1519The default value is 0. 1520.It Li ip.ipsec-comp-alg Pq Va net.inet.ip.ipsec-comp-alg 1521The compression algorithm to use with an IP Compression Association 1522.Pq IPCA . 1523Possible values are 1524.Dq deflate 1525and 1526.Dq lzs . 1527Note that lzs is only available with 1528.Xr hifn 4 . 1529See 1530.Xr ipsecctl 8 1531for more information. 1532.It Li ip.ipsec-enc-alg Pq Va net.inet.ip.ipsec-enc-alg 1533This is the default encryption algorithm the kernel will instruct key 1534management daemons to negotiate when establishing security 1535associations on behalf of the kernel. 1536Such security associations can occur as a result of a process having 1537requested some security level through 1538.Xr setsockopt 2 , 1539or as a result of dynamic VPN entries. 1540Supported values are aes, des, 3des, blowfish and cast128. 1541If set to any other value, it is left to the key management daemons to 1542select an encryption algorithm for the security association. 1543The default value is aes. 1544.It Li ip.ipsec-expire-acquire Pq Va net.inet.ip.ipsec-expire-acquire 1545How long the kernel should allow key management to dynamically acquire 1546security associations before re-sending a request. 1547The default value is 30 seconds. 1548.It Li ip.ipsec-firstuse Pq Va net.inet.ip.ipsec-firstuse 1549The number of seconds after a security association is first used before 1550it expires. 1551If set to less than or equal to zero, the security association will 1552not expire because of this timer. 1553The default value is 7200 seconds. 1554.It Li ip.ipsec-invalid-life Pq Va net.inet.ip.ipsec-invalid-life 1555The lifetime of embryonic Security Associations (SAs that key management 1556daemons have reserved but not fully established yet) in seconds. 1557If set to less than or equal to zero, embryonic SAs will not expire. 1558The default value is 60. 1559.It Li ip.ipsec-pfs Pq Va net.inet.ip.ipsec-pfs 1560If set to any non-zero value, the kernel will ask the key management 1561daemons to use Perfect Forward Secrecy when establishing IPsec 1562Security Associations. 1563Perfect Forward Secrecy makes IPsec Security Associations 1564cryptographically distinct from each other, such that breaking the key 1565for one such SA does not compromise any others. 1566Requiring PFS for every security association significantly increases the 1567computational load of 1568.Xr isakmpd 8 1569exchanges. 1570The default value is 1. 1571.It Li ip.ipsec-soft-allocs Pq Va net.inet.ip.ipsec-soft-allocs 1572The number of IPsec flows that can use a security association before a 1573message is sent by the kernel to key management for renegotiation 1574of the security association. 1575If set to less than or equal to zero, no message is sent to key 1576management. 1577The default value is 0. 1578.It Li ip.ipsec-soft-bytes Pq Va net.inet.ip.ipsec-soft-bytes 1579The number of bytes that will be processed by a security association 1580before a message is sent by the kernel to key management for 1581renegotiation of the security association. 1582If set to less than or equal to zero, no message is sent to key 1583management. 1584The default value is 0. 1585.It Li ip.ipsec-soft-firstuse Pq Va net.inet.ip.ipsec-soft-firstuse 1586The number of seconds after a security association is first used 1587before a message is sent by the kernel to key management for 1588renegotiation of the security association. 1589If set to less than or equal to zero, no message is sent to key 1590management. 1591The default value is 3600 seconds. 1592.It Li ip.ipsec-soft-timeout Pq Va net.inet.ip.ipsec-soft-timeout 1593The number of seconds after a security association is established 1594before a message is sent by the kernel to key management for 1595renegotiation of the security association. 1596If set to less than or equal to zero, no message is sent to key 1597management. 1598The default value is 80000 seconds. 1599.It Li ip.ipsec-timeout Pq Va net.inet.ip.ipsec-timeout 1600The number of seconds after a security association is established 1601before it will expire. 1602If set to less than or equal to zero, the security association will 1603not expire because of this timer. 1604The default value is 86400 seconds. 1605.It Li ip.maxqueue Pq Va net.inet.ip.maxqueue 1606Fragment flood protection. 1607Sets the maximum number of unassembled IP fragments in the fragment queue. 1608.It Li ip.mforwarding Pq Va net.inet.ip.mforwarding 1609If set to 1, then multicast forwarding is enabled for the host. 1610The default is 0. 1611.It Li ip.mtudisc Pq Va net.inet.ip.mtudisc 1612Returns 1 if Path MTU Discovery is enabled. 1613.It Li ip.mtudisctimeout Pq Va net.inet.ip.mtudisctimeout 1614Number of seconds in which a route added by the Path MTU 1615Discovery engine will time out. 1616When the route times out, the Path MTU Discovery engine will attempt 1617to probe a larger path MTU. 1618.It Li ip.multipath Pq Va net.inet.ip.multipath 1619This variable enables multipath routing for IPv4 addresses. 1620If set to 0, only the first route selected will be used for a given 1621destination regardless of how many routes exist in the routing table. 1622.It Li ip.portfirst Pq Va net.inet.ip.portfirst 1623Minimum registered port number for TCP/UDP port allocation. 1624Registered ports can be used by ordinary user processes 1625or programs executed by ordinary users. 1626Cannot be less than 1024 or greater than 49151. 1627Must be less than ip.portlast. 1628.It Li ip.porthifirst Pq Va net.inet.ip.porthifirst 1629Minimum dynamic/private port number for TCP/UDP port allocation. 1630Dynamic/private ports can be used by ordinary user processes 1631or programs executed by ordinary users. 1632Cannot be less than 49152 or greater than 65535. 1633Must be less than ip.porthilast. 1634.It Li ip.porthilast Pq Va net.inet.ip.porthilast 1635Maximum dynamic/private port number for TCP/UDP port allocation. 1636Dynamic/private ports can be used by ordinary user processes 1637or programs executed by ordinary users. 1638Cannot be less than 49152 or greater than 65535. 1639Must be greater than ip.porthifirst. 1640.It Li ip.portlast Pq Va net.inet.ip.portlast 1641Maximum registered port number for TCP/UDP port allocation. 1642Registered ports can be used by ordinary user processes 1643or programs executed by ordinary users. 1644Cannot be less than 1024 or greater than 49151. 1645Must be greater than ip.portfirst. 1646.It Li ip.redirect Pq Va net.inet.ip.redirect 1647Returns 1 when ICMP redirects may be sent by the host. 1648This option is ignored unless the host is routing IP packets, 1649and should normally be enabled on all systems. 1650.It Li ip.sourceroute Pq Va net.inet.ip.sourceroute 1651Returns 1 when forwarding of source-routed packets is enabled for 1652the host. 1653When running with a 1654.Xr securelevel 7 1655greater than 0, 1656this variable may not be changed. 1657.It Li ip.stats Pq Va net.inet.ip.stats 1658Returns the IP statistics in a struct ipstat. 1659.It Li ip.ttl Pq Va net.inet.ip.ttl 1660The maximum time-to-live (hop count) value for an IP packet 1661sourced by the system. 1662This value applies to normal transport protocols, not to ICMP. 1663.It Li ipcomp.enable Pq Va net.inet.ipcomp.enable 1664Enable the IPComp protocol. 1665See 1666.Xr ipcomp 4 1667for more information. 1668.It Li ipip.allow Pq Va net.inet.ipip.allow 1669If set to 0, incoming IP-in-IP packets will not be processed. 1670If set to any other value, processing will occur; furthermore, if set 1671to 2, no checks for spoofing of loopback addresses will be done. 1672This is useful only for debugging purposes, and should never be used 1673in production systems. 1674.It Li tcp.ackonpush Pq Va net.inet.tcp.ackonpush 1675Returns 1 if TCP segments with the 1676.Dv TH_PUSH 1677flag set are being acknowledged immediately, otherwise 0. 1678.It Li tcp.baddynamic Pq Va net.inet.tcp.baddynamic 1679An array of 1680.Vt in_port_t 1681is returned specifying the bitmask of TCP ports between 512 1682and 1023 inclusive that should not be allocated dynamically 1683by the kernel (i.e., they must be bound specifically by port number). 1684.It Li tcp.ecn Pq Va net.inet.tcp.ecn 1685Returns 1 if Explicit Congestion Notifications for TCP are enabled. 1686.It Li tcp.ident Pq Va net.inet.tcp.ident 1687A 1688.Vt struct tcp_ident_mapping 1689specifying a local and foreign endpoint of a TCP 1690socket is filled in with the effective and real UIDs of the process that 1691owns the socket. 1692If no such socket exists, then the effective and real UID values are 1693both set to \-1. 1694.It Li tcp.keepidle Pq Va net.inet.tcp.keepidle 1695If the socket option 1696.Dv SO_KEEPALIVE 1697has been set on a socket, then this value specifies how much time a 1698connection needs to be idle before keepalives are sent. 1699See also tcp.slowhz. 1700.It Li tcp.keepinittime Pq Va net.inet.tcp.keepinittime 1701Time to keep alive the initial SYN packet of a TCP handshake. 1702.It Li tcp.keepintvl Pq Va net.inet.tcp.keepintvl 1703Time after a keepalive probe is sent until, in the absence of any response, 1704another probe is sent. 1705See also tcp.slowhz. 1706.It Li tcp.always_keepalive Pq Va net.inet.tcp.always_keepalive 1707Act as if the option 1708.Dv SO_KEEPALIVE 1709was set on all TCP sockets. 1710.It Li tcp.mssdflt Pq Va net.inet.tcp.mssdflt 1711The maximum segment size that is used as default for non-local connections. 1712The default value is 512. 1713.It Li tcp.reasslimit Pq Va net.inet.tcp.reasslimit 1714The maximum number of out-of-order TCP 1715segments the system will store for reassembly. 1716.It Li tcp.rfc1323 Pq Va net.inet.tcp.rfc1323 1717Returns 1 if RFC 1323 extensions to TCP are enabled. 1718.It Li tcp.rfc3390 Pq Va net.inet.tcp.rfc3390 1719Returns 1 if the TCP Initial Window 1720is increased to 4 * MSS or 4380 bytes, as specified in RFC 3390. 1721Returns 2 if the TCP Initial Window 1722is increased to 10 * MSS or 14600 bytes, as specified in 1723RFC 6928. 1724.It Li tcp.rootonly Pq Va net.inet.tcp.rootonly 1725An array of 1726.Vt in_port_t 1727is returned specifying the bitmask of TCP ports 1728that can only be bound by processes with root euid. 1729When running with a 1730.Xr securelevel 7 1731greater than 0, 1732this variable may not be changed. 1733.It Li tcp.rstppslimit Pq Va net.inet.tcp.rstppslimit 1734This variable specifies the maximum number of outgoing TCP RST packets 1735per second. 1736TCP RST packets exceeding this value are subject to rate limitation 1737and will not go out from the node. 1738A negative value disables rate limitation. 1739.It Li tcp.sack Pq Va net.inet.tcp.sack 1740Returns 1 if RFC 2018 Selective Acknowledgements are enabled. 1741.It Li tcp.slowhz Pq Va net.inet.tcp.slowhz 1742The units for tcp.keepidle and tcp.keepintvl; those variables are in ticks 1743of a clock that ticks tcp.slowhz times per second. 1744(That is, their values must be divided by the tcp.slowhz value to get times 1745in seconds.) 1746.It Li tcp.stats Pq Va net.inet.tcp.stats 1747Returns the TCP statistics in a struct tcpstat. 1748.It Li tcp.synbucketlimit Pq Va net.inet.tcp.synbucketlimit 1749The maximum number of entries allowed per hash bucket in the TCP SYN cache. 1750.It Li tcp.syncachelimit Pq Va net.inet.tcp.syncachelimit 1751The maximum number of entries allowed in the TCP SYN cache. 1752.It Li tcp.synhashsize Pq Va net.inet.tcp.synhashsize 1753The number of buckets in the TCP SYN cache hash array. 1754After the value is set, the actual size changes when the alternative 1755SYN cache becomes empty and both SYN caches are swapped. 1756.It Li tcp.synuselimit Pq Va net.inet.tcp.synuselimit 1757The minimum number of times the hash function for the TCP SYN cache is used 1758before it is reseeded. 1759.It Li udp.baddynamic Pq Va net.inet.udp.baddynamic 1760Analogous to 1761.Li tcp.baddynamic 1762but for UDP sockets. 1763.It Li udp.checksum Pq Va net.inet.udp.checksum 1764Returns 1 when UDP checksums are being computed and checked. 1765Disabling UDP checksums is strongly discouraged. 1766.It Li udp.recvspace Pq Va net.inet.udp.recvspace 1767Returns the default UDP receive buffer size. 1768.It Li udp.rootonly Pq Va net.inet.udp.rootonly 1769Analogous to 1770.Li tcp.rootonly 1771but for UDP sockets. 1772.It Li udp.sendspace Pq Va net.inet.udp.sendspace 1773Returns the default UDP send buffer size. 1774.It Li udp.stats Pq Va net.inet.udp.stats 1775Returns the UDP statistics in a struct udpstat. 1776.El 1777.It Dv PF_INET6 1778Get or set various global information about IPv6 1779.Pq Internet Protocol version 6 . 1780The third level name is the protocol. 1781The fourth level name is the variable name. 1782The currently defined protocols and names are: 1783.Bl -column "Protocol name" "multicast_mtudisc" "integer" "yes" -offset indent 1784.It Sy "Protocol name" Ta Sy "Variable name" Ta Sy "Type" Ta Sy "Changeable" 1785.It icmp6 Ta errppslimit Ta integer Ta yes 1786.It icmp6 Ta mtudisc_hiwat Ta integer Ta yes 1787.It icmp6 Ta mtudisc_lowat Ta integer Ta yes 1788.It icmp6 Ta nd6_debug Ta integer Ta yes 1789.It icmp6 Ta nd6_delay Ta integer Ta yes 1790.It icmp6 Ta nd6_maxnudhint Ta integer Ta yes 1791.It icmp6 Ta nd6_mmaxtries Ta integer Ta yes 1792.It icmp6 Ta nd6_umaxtries Ta integer Ta yes 1793.It icmp6 Ta redirtimeout Ta integer Ta yes 1794.It ip6 Ta auto_flowlabel Ta integer Ta yes 1795.It ip6 Ta dad_count Ta integer Ta yes 1796.It ip6 Ta dad_pending Ta integer Ta yes 1797.It ip6 Ta defmcasthlim Ta integer Ta yes 1798.It ip6 Ta forwarding Ta integer Ta yes 1799.It ip6 Ta hdrnestlimit Ta integer Ta yes 1800.It ip6 Ta hlim Ta integer Ta yes 1801.It ip6 Ta log_interval Ta integer Ta yes 1802.It ip6 Ta maxdynroutes Ta integer Ta yes 1803.It ip6 Ta maxfragpackets Ta integer Ta yes 1804.It ip6 Ta maxfrags Ta integer Ta yes 1805.It ip6 Ta mforwarding Ta integer Ta yes 1806.It ip6 Ta mtudisctimeout Ta integer Ta yes 1807.It ip6 Ta multicast_mtudisc Ta integer Ta yes 1808.It ip6 Ta multipath Ta integer Ta yes 1809.It ip6 Ta neighborgcthresh Ta integer Ta yes 1810.It ip6 Ta redirect Ta integer Ta yes 1811.It ip6 Ta soiikey Ta uint8_t[IP6_SOIIKEY_LEN] Ta yes 1812.It ip6 Ta use_deprecated Ta integer Ta yes 1813.El 1814.Pp 1815The variables are as follows: 1816.Pp 1817.Bl -tag -width "123456" -compact 1818.It Li icmp6.errppslimit Pq Va net.inet6.icmp6.errppslimit 1819This variable specifies the maximum number of outgoing ICMPv6 error messages 1820per second. 1821ICMPv6 error messages exceeding this value are subject to rate limitation 1822and will not go out from the node. 1823A negative value will disable the rate limitation. 1824.Pp 1825.It Li icmp6.mtudisc_hiwat Pq Va net.inet6.icmp6.mtudisc_hiwat 1826.It Li icmp6.mtudisc_lowat Pq Va net.inet6.icmp6.mtudisc_lowat 1827These variables define the maximum number of routing table entries 1828created due to path MTU discovery 1829.Pq preventing denial-of-service attacks with ICMPv6 too big messages . 1830After IPv6 path MTU discovery happens, path MTU information is kept in 1831the routing table. 1832If the number of routing table entries exceeds this value, 1833the kernel will not attempt to keep the path MTU information. 1834.Li icmp6.mtudisc_hiwat 1835is used when we have verified ICMPv6 too big messages. 1836.Li icmp6.mtudisc_lowat 1837is used when we have unverified ICMPv6 too big messages. 1838Verification is performed by using address/port pairs kept in connected PCBs. 1839A negative value disables the upper limit. 1840.Pp 1841.It Li icmp6.nd6_debug Pq Va net.inet6.icmp6.nd6_debug 1842If set to non-zero, IPv6 neighbor discovery will generate debugging 1843messages. 1844The debug output is useful for diagnosing IPv6 interoperability issues. 1845The flag must be set to 0 for normal operation. 1846.Pp 1847.It Li icmp6.nd6_delay Pq Va net.inet6.icmp6.nd6_delay 1848This variable specifies the 1849.Dv DELAY_FIRST_PROBE_TIME 1850timing constant in IPv6 neighbor discovery specification 1851.Pq RFC 4861 , 1852in seconds. 1853.Pp 1854.It Li icmp6.nd6_maxnudhint Pq Va net.inet6.icmp6.nd6_maxnudhint 1855IPv6 neighbor discovery permits upper layer protocols to supply reachability 1856hints, to avoid unnecessary neighbor discovery exchanges. 1857This variable defines the number of consecutive hints the neighbor discovery 1858layer will take. 1859For example, by setting the variable to 3, neighbor discovery will take 1860a maximum of 3 consecutive hints. 1861After receiving 3 hints, the neighbor discovery layer will instead perform 1862the normal neighbor discovery process. 1863.Pp 1864.It Li icmp6.nd6_mmaxtries Pq Va net.inet6.icmp6.nd6_mmaxtries 1865This variable specifies the 1866.Dv MAX_MULTICAST_SOLICIT 1867constant in IPv6 neighbor discovery specification 1868.Pq RFC 4861 . 1869.Pp 1870.It Li icmp6.nd6_umaxtries Pq Va net.inet6.icmp6.nd6_umaxtries 1871This variable specifies the 1872.Dv MAX_UNICAST_SOLICIT 1873constant in IPv6 neighbor discovery specification 1874.Pq RFC 4861 . 1875.Pp 1876.It Li icmp6.redirtimeout Pq Va net.inet6.icmp6.redirtimeout 1877The variable specifies the lifetime of routing entries generated by 1878incoming ICMPv6 redirects. 1879.Pp 1880.It Li ip6.auto_flowlabel Pq Va net.inet6.ip6.auto_flowlabel 1881On connected transport protocol packets, 1882fill the IPv6 flowlabel field to help intermediate routers identify 1883packet flows. 1884.Pp 1885.It Li ip6.dad_count Pq Va net.inet6.ip6.dad_count 1886This variable configures the number of IPv6 DAD 1887.Pq duplicated address detection 1888probe packets. 1889These packets are generated when IPv6 interfaces are first brought up. 1890.Pp 1891.It Li ip6.dad_pending Pq Va net.inet6.ip6.dad_pending 1892This variable displays the number of pending IPv6 DAD 1893.Pq duplicated address detection 1894before completion. 1895It is used to make sure that DAD is completed before 1896.Xr netstart 8 1897is executed. 1898.Pp 1899.It Li ip6.defmcasthlim Pq Va net.inet6.ip6.defmcasthlim 1900The default hop limit value for an IPv6 multicast packet sourced by the node. 1901This value applies to all the transport protocols on top of IPv6. 1902Methods for overriding this value are documented in 1903.Xr ip6 4 . 1904.Pp 1905.It Li ip6.forwarding Pq Va net.inet6.ip6.forwarding 1906Returns 1 when IPv6 forwarding is enabled for the node, 1907meaning that the node is acting as a router. 1908Returns 0 when IPv6 forwarding is disabled for the node, 1909meaning that the node is acting as a host. 1910Note that IPv6 defines node behavior for the 1911.Dq router 1912and 1913.Dq host 1914cases quite differently, and changing this variable during operation 1915may cause serious trouble. 1916Hence, this variable should only be set at bootstrap time. 1917As with IPv4, if forwarding is disabled then the destination address of 1918incoming packets must match the IP address bound to the interface. 1919If forwarding is enabled, the check is relaxed so that the destination IP address of 1920incoming packets must match just any address bound to the host. 1921.Pp 1922.It Li ip6.hdrnestlimit Pq Va net.inet6.ip6.hdrnestlimit 1923The number of IPv6 extension headers permitted on incoming IPv6 packets. 1924If set to 0, the node will accept as many extension headers as possible. 1925.Pp 1926.It Li ip6.hlim Pq Va net.inet6.ip6.hlim 1927The default hop limit value for an IPv6 unicast packet sourced by the node. 1928This value applies to all the transport protocols on top of IPv6. 1929Methods for overriding this value are documented in 1930.Xr ip6 4 . 1931.Pp 1932.It Li ip6.log_interval Pq Va net.inet6.ip6.log_interval 1933This variable permits adjusting the amount of logs generated by the 1934IPv6 packet forwarding engine. 1935The value indicates the number of 1936seconds of interval which must elapse between log output. 1937.Pp 1938.It Li ip6.maxdynroutes Pq Va net.inet6.ip6.maxdynroutes 1939Maximum number of routes created by redirect. 1940Set to negative to disable. 1941The default value is 4096. 1942.Pp 1943.It Li ip6.maxfragpackets Pq Va net.inet6.ip6.maxfragpackets 1944The maximum number of fragmented packets the node will accept. 19450 means that the node will not accept any fragmented packets. 1946\-1 means that the node will accept as many fragmented packets as it receives. 1947The flag is provided basically for avoiding possible DoS attacks. 1948.Pp 1949.It Li ip6.maxfrags Pq Va net.inet6.ip6.maxfrags 1950The maximum number of fragments the node will accept. 19510 means that the node will not accept any fragments. 1952\-1 means that the node will accept as many fragments as it receives. 1953The flag is provided basically for avoiding possible DoS attacks. 1954.Pp 1955.It Li ip6.mforwarding Pq Va net.inet6.ip6.mforwarding 1956If set to 1, then multicast forwarding is enabled for the host. 1957The default is 0. 1958.Pp 1959.It Li ip6.multicast_mtudisc Pq Va net.inet6.ip6.multicast_mtudisc 1960This variable controls generation of ICMPv6 Too Big messages 1961when the machine is performing as an IPv6 multicast router. 1962If set to 1, an ICMPv6 Too Big message will be generated for multicast packets 1963which were too big to be forwarded. 1964If set to 0, the ICMPv6 Too Big message will be suppressed. 1965.Pp 1966.It Li ip6.multipath Pq Va net.inet6.ip6.multipath 1967This variable enables multipath routing for IPv6 addresses. 1968If set to 0, only the first route selected will be used for a given 1969destination regardless of how many routes exist in the routing table. 1970.Pp 1971.It Li ip6.mtudisctimeout Pq Va net.inet6.ip6.mtudisctimeout 1972Number of seconds in which a route added by the Path MTU 1973Discovery engine will time out. 1974When the route times out, the Path MTU Discovery engine will attempt 1975to probe a larger path MTU. 1976.Pp 1977.It Li ip6.neighborgcthresh Pq Va net.inet6.ip6.neighborgcthresh 1978Maximum number of entries in neighbor cache. 1979Set to negative to disable. 1980The default value is 2048. 1981.Pp 1982.It Li ip6.redirect Pq Va net.inet6.ip6.redirect 1983Returns 1 when ICMPv6 redirects may be sent by the node. 1984This option is ignored unless the node is routing IP packets, 1985and should normally be enabled on all systems. 1986.Pp 1987.It Li ip6.soii Pq Va net.inet6.ip6.soiikey 1988This variable configures the secret key for the RFC 7217 algorithm to 1989calculate a persistent Semantically Opaque Interface Identifier (SOII) 1990for IPv6 Stateless Address Autoconfiguration (SLAAC) addresses. 1991It must be 1992.Dv IP6_SOIIKEY_LEN 1993bytes long. 1994.Pp 1995.It Li ip6.use_deprecated Pq Va net.inet6.ip6.use_deprecated 1996This variable controls the use of deprecated addresses, specified in 1997RFC 4862 5.5.4. 1998.El 1999.Pp 2000We reuse 2001.Li net.inet.tcp 2002and 2003.Li net.inet.udp 2004for TCP/UDP over IPv6. 2005.It Dv PF_UNIX 2006Get or set various global information about UNIX-domain protocol family. 2007The third level name is the socket type. 2008The fourth level name is the variable name. 2009The currently defined socket types and names are: 2010.Bl -column "Protocol name" "ipsec-expire-acquire" "structure" "Changeable" -offset 2n 2011.It Sy "Socket type" Ta Sy "Variable name" Ta Sy "Type" Ta Sy "Changeable" 2012.It stream Ta recvspace Ta integer Ta yes 2013.It stream Ta sendspace Ta integer Ta yes 2014.It dgram Ta recvspace Ta integer Ta yes 2015.It dgram Ta sendspace Ta integer Ta yes 2016.It seqpacket Ta recvspace Ta integer Ta yes 2017.It seqpacket Ta sendspace Ta integer Ta yes 2018.It inflight Ta Ta integer Ta no 2019.It deferred Ta Ta integer Ta no 2020.El 2021.Pp 2022The variables are as follows: 2023.Bl -tag -width "123456" 2024.It Li stream.recvspace Pq Va net.unix.stream.recvspace 2025Returns the default 2026.Dv SOCK_STREAM 2027receive buffer size. 2028.It Li stream.sendspace Pq Va net.unix.stream.sendspace 2029Returns the default 2030.Dv SOCK_STREAM 2031send buffer size. 2032.It Li dgram.recvspace Pq Va net.unix.dgram.recvspace 2033Returns the default 2034.Dv SOCK_DGRAM 2035receive buffer size. 2036.It Li dgram.sendspace Pq Va net.unix.dgram.sendspace 2037Returns the default 2038.Dv SOCK_DGRAM 2039send buffer size. 2040.It Li seqpacket.recvspace Pq Va net.unix.seqpacket.recvspace 2041Returns the default 2042.Dv SOCK_SEQPACKET 2043receive buffer size. 2044.It Li seqpacket.sendspace Pq Va net.unix.seqpacket.sendspace 2045Returns the default 2046.Dv SOCK_SEQPACKET 2047send buffer size. 2048.It Li inflight Pq Va net.unix.inflight 2049Returns the number of file descriptors inflight. 2050.It Li deferred Pq Va net.unix.deferred 2051Returns the number of file descriptors to be closed. 2052.El 2053.It Dv PF_KEY 2054Return 2055.Xr ipsec 4 2056database dumps. 2057The second level name is 2058.Dv PF_KEY_V2 . 2059The third level name selects the database as follows: 2060.Pp 2061.Bl -tag -width "NET_KEY_SADB_DUMP" -offset indent -compact 2062.It Dv NET_KEY_SADB_DUMP 2063Security Association database (SADB). 2064.It Dv NET_KEY_SPD_DUMP 2065IPsec flow database (SPD). 2066.El 2067.It Dv PF_MPLS 2068Get or set global information about MPLS (Multiprotocol Label Switching). 2069.Bl -column "MPLSCTL_MAPTTL_IP6 " "integer" "not applicable" -offset indent 2070.It Sy "Third level name" Ta Sy "Type" Ta Sy "Changeable" 2071.It Dv MPLSCTL_DEFTTL Ta integer Ta yes 2072.It Dv MPLSCTL_MAPTTL_IP Ta integer Ta yes 2073.It Dv MPLSCTL_MAPTTL_IP6 Ta integer Ta yes 2074.El 2075.Bl -tag -width "123456" 2076.It Dv MPLSCTL_DEFTTL Pq Va net.mpls.ttl 2077Set or get the default TTL value which is used for MPLS (Shim) Header. 2078The default is 255. 2079.It Dv MPLSCTL_MAPTTL_IP Pq Va net.mpls.mapttl_ip 2080If set to 1 the TTL field is synchronized between the IP header and the 2081MPLS label stack. 2082If set to 0 the IP header TTL is not modified while passing through MPLS 2083and the MPLS label stack is initialized with the 2084.Dv MPLSCTL_DEFTTL . 2085The default is 1. 2086.It Dv MPLSCTL_MAPTTL_IP6 Pq Va net.mpls.mapttl_ip6 2087If set to 1 the TTL field is synchronized between the IPv6 header and the 2088MPLS label stack. 2089If set to 0 the IPv6 header TTL is not modified while passing through MPLS 2090and the MPLS label stack is initialized with the 2091.Dv MPLSCTL_DEFTTL . 2092The default is 0. 2093.El 2094.It Dv PF_PIPEX Pq Va net.pipex 2095Get or set global information about PIPEX. 2096.Pp 2097The currently defined variable names are: 2098.Bl -column "Third level name" "integer" "Changeable" -offset indent 2099.It Sy "Third level name" Ta Sy "Type" Ta Sy "Changeable" 2100.It Dv PIPEXCTL_ENABLE Ta integer Ta yes 2101.El 2102.Bl -tag -width "123456" 2103.It Dv PIPEXCTL_ENABLE 2104If set to 1, enable PIPEX processing. 2105The default is 0. 2106.El 2107.El 2108.Ss CTL_VFS 2109The string and integer information available for the 2110.Dv CTL_VFS 2111level is detailed below. 2112The changeable column shows whether a process with appropriate 2113privileges may change the value. 2114.Bl -column "Second level name" "VFS generic info" "Changeable" -offset indent 2115.It Sy "Second level name" Ta Sy "Type" Ta Sy "Changeable" 2116.It Dv VFS_GENERIC Ta "VFS generic info" Ta "no" 2117.It Dv "filesystem #" Ta "filesystem info" Ta "no" 2118.El 2119.Bl -tag -width "123456" 2120.It Dv VFS_GENERIC 2121This second level identifier requests generic information about the 2122VFS layer. 2123Within it, the following third level identifiers exist: 2124.Bl -column "Third level name" "struct vfsconf" "Changeable" -offset indent 2125.It Sy "Third level name" Ta Sy "Type" Ta Sy "Changeable" 2126.It Dv VFS_CONF Ta "struct vfsconf" Ta "no" 2127.It Dv VFS_MAXTYPENUM Ta "int" Ta "no" 2128.El 2129.It filesystem # 2130After finding the filesystem dependent 2131.Va vfc_typenum 2132using 2133.Dv VFS_GENERIC 2134with 2135.Dv VFS_CONF , 2136it is possible to access filesystem dependent information. 2137.Pp 2138Some filesystems may contain settings. 2139.Bl -tag -width "123" 2140.It FFS 2141.Bl -column "FFS_SD_DIRECT_BLK_PTRS" "integer" "Changeable" -offset indent 2142.It Sy "Third level name" Ta Sy "Type" Ta Sy "Changeable" 2143.It Dv FFS_DIRHASH_DIRSIZE Ta "integer" Ta "yes" 2144.It Dv FFS_DIRHASH_MAXMEM Ta "integer" Ta "yes" 2145.It Dv FFS_DIRHASH_MEM Ta "integer" Ta "no" 2146.It Dv FFS_MAX_SOFTDEPS Ta "integer" Ta "yes" 2147.It Dv FFS_SD_BLK_LIMIT_HIT Ta "integer" Ta "yes" 2148.It Dv FFS_SD_BLK_LIMIT_PUSH Ta "integer" Ta "yes" 2149.It Dv FFS_SD_DIR_ENTRY Ta "integer" Ta "yes" 2150.It Dv FFS_SD_DIRECT_BLK_PTRS Ta "integer" Ta "yes" 2151.It Dv FFS_SD_INDIR_BLK_PTRS Ta "integer" Ta "yes" 2152.It Dv FFS_SD_INO_LIMIT_HIT Ta "integer" Ta "yes" 2153.It Dv FFS_SD_INO_LIMIT_PUSH Ta "integer" Ta "yes" 2154.It Dv FFS_SD_INODE_BITMAP Ta "integer" Ta "yes" 2155.It Dv FFS_SD_SYNC_LIMIT_HIT Ta "integer" Ta "yes" 2156.It Dv FFS_SD_TICKDELAY Ta "integer" Ta "yes" 2157.It Dv FFS_SD_WORKLIST_PUSH Ta "integer" Ta "yes" 2158.El 2159.Bl -tag -width "123456" 2160.It Dv FFS_DIRHASH_DIRSIZE Pq Va vfs.ffs.dirhash_dirsize 2161The minimum size of a directory, in bytes, before it is considered for hashing. 2162.It Dv FFS_DIRHASH_MAXMEM Pq Va vfs.ffs.dirhash_maxmem 2163The maximum amount of memory, in bytes, to be used for storing directory 2164hashes. 2165.It Dv FFS_DIRHASH_MEM Pq Va vfs.ffs.dirhash_mem 2166The amount of memory currently used by all directory hashes. 2167.It Dv FFS_MAX_SOFTDEPS Pq Va vfs.ffs.max_softdeps 2168Maximum structures before slowdowns. 2169.It Dv FFS_SD_BLK_LIMIT_HIT Pq Va vfs.ffs.sd_blk_limit_hit 2170Number of times block slowdown imposed. 2171.It Dv FFS_SD_BLK_LIMIT_PUSH Pq Va vfs.ffs.sd_blk_limit_push 2172Number of times block limit neared. 2173.It Dv FFS_SD_DIR_ENTRY Pq Va vfs.ffs.sd_dir_entry 2174Bufs redirtied as dir entry cannot write. 2175.It Dv FFS_SD_DIRECT_BLK_PTRS Pq Va vfs.ffs.sd_direct_blk_ptrs 2176Bufs redirtied as direct ptrs not written. 2177.It Dv FFS_SD_INDIR_BLK_PTRS Pq Va vfs.ffs.sd_indir_blk_ptrs 2178Bufs redirtied as indirect ptrs not written. 2179.It Dv FFS_SD_INO_LIMIT_HIT Pq Va vfs.ffs.sd_ino_limit_hit 2180Number of times inode limit imposed. 2181.It Dv FFS_SD_INO_LIMIT_PUSH Pq Va vfs.ffs.sd_ino_limit_push 2182Number of times inode limit neared. 2183.It Dv FFS_SD_INODE_BITMAP Pq Va vfs.ffs.sd_inode_bitmap 2184Bufs redirtied as inode bitmap not written. 2185.It Dv FFS_SD_SYNC_LIMIT_HIT Pq Va vfs.ffs.sd_sync_limit_hit 2186Number of synchronous slowdowns imposed. 2187.It Dv FFS_SD_TICKDELAY Pq Va vfs.ffs.sd_tickdelay 2188Ticks to pause during slowdown. 2189.It Dv FFS_SD_WORKLIST_PUSH Pq Va vfs.ffs.sd_worklist_push 2190Number of worklist cleanups. 2191.El 2192.It NFS 2193.Bl -column "Third level name" "struct nfsstats" "Changeable" -offset indent 2194.It Sy "Third level name" Ta Sy "Type" Ta Sy "Changeable" 2195.It Dv NFS_NFSSTATS Ta "struct nfsstats" Ta "yes" 2196.It Dv NFS_NIOTHREADS Ta "int" Ta "yes" 2197.El 2198.Bl -tag -width Ds 2199.It Dv NFS_NIOTHREADS Pq Va vfs.nfs.iothreads 2200The number of I/O kernel threads for NFS clients. 2201The default is 4; 2202the maximum is 20. 2203.El 2204.It FUSE 2205.Bl -column "FUSEFS_POOL_NBPAGES" "Type" "Changeable" -offset indent 2206.It Sy "Third level name" Ta Sy "Type" Ta Sy "Changeable" 2207.It Dv FUSEFS_INFBUFS Ta "int" Ta "no" 2208.It Dv FUSEFS_OPENDEVS Ta "int" Ta "no" 2209.It Dv FUSEFS_POOL_NBPAGES Ta "int" Ta "no" 2210.It Dv FUSEFS_WAITFBUFS Ta "int" Ta "no" 2211.El 2212.Bl -tag -width Ds 2213.It Dv FUSEFS_INFBUFS Pq Va vfs.fuse.fusefs_fbufs_in 2214The number of inbound fusebufs. 2215.It Dv FUSEFS_OPENDEVS Pq Va vfs.fuse.fusefs_open_devices 2216The number of FUSE devices opened. 2217.It Dv FUSEFS_POOL_NBPAGES Pq Va vfs.fuse.fusefs_pool_pages 2218The number of pages used for fusebuf memory. 2219.It Dv FUSEFS_WAITFBUFS Pq Va vfs.fuse.fusefs_fbufs_wait 2220The number of fusebufs waiting for a response. 2221.El 2222.El 2223.El 2224.Ss CTL_VM 2225The string and integer information available for the 2226.Dv CTL_VM 2227level is detailed below. 2228The changeable column shows whether a process with appropriate 2229privileges may change the value. 2230.Bl -column "Second level name" "swap encrypt values" "yes" -offset indent 2231.It Sy "Second level name" Ta Sy "Type" Ta Sy "Changeable" 2232.It Dv VM_ANONMIN Ta "integer" Ta "yes" 2233.It Dv VM_LOADAVG Ta "struct loadavg" Ta "no" 2234.It Dv VM_MALLOC_CONF Ta "string" Ta "yes" 2235.It Dv VM_MAXSLP Ta "integer" Ta "no" 2236.It Dv VM_METER Ta "struct vmtotal" Ta "no" 2237.It Dv VM_NKMEMPAGES Ta "integer" Ta "no" 2238.It Dv VM_PSSTRINGS Ta "struct psstrings" Ta "no" 2239.It Dv VM_SWAPENCRYPT Ta "swap encrypt values" Ta "yes" 2240.It Dv VM_USPACE Ta "integer" Ta "no" 2241.It Dv VM_UVMEXP Ta "struct uvmexp" Ta "no" 2242.It Dv VM_VNODEMIN Ta "integer" Ta "yes" 2243.It Dv VM_VTEXTMIN Ta "integer" Ta "yes" 2244.El 2245.Bl -tag -width "123456" 2246.It Dv VM_ANONMIN Pq Va vm.anonmin 2247Percentage of physical memory available for 2248pages which contain anonymous mapping. 2249.It Dv VM_LOADAVG Pq Va vm.loadavg 2250Return the load average history. 2251The returned data consists of a 2252.Vt struct loadavg . 2253.It Dv VM_MALLOC_CONF Pq Va vm.malloc_conf 2254String of option flags for the 2255.Xr malloc 3 2256family of functions 2257which will be applied to all programs starting in the future. 2258The string contains a maximum of 15 characters. 2259.It Dv VM_MAXSLP Pq Va vm.maxslp 2260The time for a process to be blocked before being swappable, 2261in seconds. 2262.It Dv VM_METER Pq Va vm.vmmeter 2263Return the system wide virtual memory statistics. 2264The returned data consists of a 2265.Vt struct vmtotal . 2266.It Dv VM_NKMEMPAGES Pq Va vm.nkmempages 2267Number of pages in kmem_map. 2268.It Dv VM_PSSTRINGS Pq Va vm.psstrings 2269Returns the address of the process 2270.Vt struct ps_strings . 2271The 2272.Xr ps 1 2273program uses it to locate the argument and environment strings. 2274.It Dv VM_SWAPENCRYPT 2275Contains statistics about swap encryption. 2276The string and integer information available for the third level is 2277detailed below. 2278.Bl -column "Third level name" "integer" "Changeable" -offset indent 2279.It Sy "Third level name" Ta Sy "Type" Ta Sy "Changeable" 2280.It Dv SWPENC_CREATED Ta "integer" Ta "no" 2281.It Dv SWPENC_DELETED Ta "integer" Ta "no" 2282.It Dv SWPENC_ENABLE Ta "integer" Ta "yes" 2283.El 2284.Bl -tag -width "123456" 2285.It Dv SWPENC_CREATED Pq Va vm.swapencrypt.keyscreated 2286The number of encryption keys that have been randomly created. 2287The swap partition is divided into sections of normally 512KB. 2288Each section has its own encryption key. 2289.It Dv SWPENC_DELETED Pq Va vm.swapencrypt.keysdeleted 2290The number of encryption keys that have been deleted, thus effectively 2291erasing the data that has been encrypted with them. 2292Encryption keys are deleted when their reference counter reaches zero. 2293.It Dv SWPENC_ENABLE Pq Va vm.swapencrypt.enable 2294Set to 1 to enable swap encryption for all processes. 2295A 0 disables swap encryption. 2296Pages still on swap receive a grandfather clause. 2297Turning this option on does not affect legacy swap data already on the disk, 2298but all newly written data will be encrypted. 2299When swap encryption is turned on, automatic 2300.Xr crash 8 2301dumps are disabled. 2302.El 2303.It Dv VM_USPACE Pq Va vm.uspace 2304The number of bytes allocated for each kernel stack. 2305.It Dv VM_UVMEXP Pq Va vm.uvmexp 2306Contains statistics about the UVM memory management system. 2307.It Dv VM_VNODEMIN Pq Va vm.vnodemin 2308Percentage of physical memory available for 2309pages which contain cached file data. 2310.It Dv VM_VTEXTMIN Pq Va vm.vtextmin 2311Percentage of physical memory available for 2312pages which contain cached executable data. 2313.El 2314.Sh RETURN VALUES 2315If the call to 2316.Fn sysctl 2317is unsuccessful, \-1 is returned and 2318.Va errno 2319is set appropriately. 2320.Sh FILES 2321.Bl -tag -width "uvm/uvmXswapXencrypt.h " -compact 2322.It In sys/sysctl.h 2323top level identifiers and second level kernel and hardware 2324identifiers 2325.It In sys/socket.h 2326second level network identifiers 2327.It In sys/gmon.h 2328third level profiling identifiers 2329.It In uvm/uvm_param.h 2330second level virtual memory identifiers 2331.It In uvm/uvm_swap_encrypt.h 2332third level virtual memory identifiers 2333.It In net/if.h 2334packet input/output queue identifiers 2335.It In net/pipex.h 2336third level PIPEX identifiers 2337.It In netinet/in.h 2338third and fourth level IPv4/v6 identifiers 2339.It In netinet/ip_divert.h 2340fourth level divert identifiers 2341.It In netinet/icmp_var.h 2342fourth level ICMP identifiers 2343.It In netinet/icmp6.h 2344fourth level ICMPv6 identifiers 2345.It In netinet/tcp_var.h 2346fourth level TCP identifiers 2347.It In netinet/udp_var.h 2348fourth level UDP identifiers 2349.It In ddb/db_var.h 2350second level ddb identifiers 2351.It In sys/mount.h 2352second level vfs identifiers 2353.It In miscfs/fuse/fusefs.h 2354third level fusefs identifiers 2355.It In nfs/nfs.h 2356third level NFS identifiers 2357.It In ufs/ffs/ffs_extern.h 2358third level FFS identifiers 2359.It In machine/cpu.h 2360second level CPU identifiers 2361.El 2362.Sh ERRORS 2363The following errors may be reported: 2364.Bl -tag -width Er 2365.It Bq Er EFAULT 2366The buffer 2367.Fa name , 2368.Fa oldp , 2369.Fa newp , 2370or length pointer 2371.Fa oldlenp 2372contains an invalid address. 2373.It Bq Er EINVAL 2374The 2375.Fa name 2376array is less than two or greater than 2377.Dv CTL_MAXNAME . 2378.It Bq Er EINVAL 2379A non-null 2380.Fa newp 2381pointer is given and its specified length in 2382.Fa newlen 2383is too large or too small. 2384.It Bq Er ENOMEM 2385The length pointed to by 2386.Fa oldlenp 2387is too short to hold the requested value. 2388.It Bq Er ENOENT 2389The mib specified does not exist, or exceeds the range that is possible. 2390.It Bq Er ENXIO 2391If the mib is a sparsely populated array, this error may be returned 2392instead. 2393.It Bq Er ENOTDIR 2394The 2395.Fa name 2396array specifies an intermediate rather than terminal name. 2397.It Bq Er EOPNOTSUPP 2398The 2399.Fa name 2400array specifies a value that is unknown. 2401.It Bq Er EPERM 2402An attempt is made to set a read-only value. 2403.It Bq Er EPERM 2404A process without appropriate privileges attempts to set a value. 2405.It Bq Er EPERM 2406An attempt to change a value protected by the current kernel security 2407level is made. 2408.It Bq Er ESRCH 2409No process could be found which corresponds to the given process ID. 2410.El 2411.Sh SEE ALSO 2412.Xr pathconf 2 , 2413.Xr sysconf 3 , 2414.Xr ddb 4 , 2415.Xr sysctl.conf 5 , 2416.Xr securelevel 7 , 2417.Xr sysctl 8 2418.Sh HISTORY 2419The 2420.Fn sysctl 2421function first appeared in 2422.Bx 4.4 . 2423