2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. Neither the name of the University nor the names of its contributors
13 .\" may be used to endorse or promote products derived from this software
14 .\" without specific prior written permission.
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" @(#)sysctl.3 8.4 (Berkeley) 5/9/95
29 .\" $FreeBSD: src/lib/libc/gen/sysctl.3,v 1.33.2.13 2002/04/07 04:57:14 dd Exp $
38 .Nd get or set system information
45 .Fn sysctl "const int *name" "u_int namelen" "void *oldp" "size_t *oldlenp" "const void *newp" "size_t newlen"
47 .Fn sysctlbyname "const char *name" "void *oldp" "size_t *oldlenp" "const void *newp" "size_t newlen"
49 .Fn sysctlnametomib "const char *name" "int *mibp" "size_t *sizep"
53 function retrieves system information and allows processes with
54 appropriate privileges to set system information.
55 The information available from
57 consists of integers, strings, and tables.
58 Information may be retrieved and set from the command interface
63 Unless explicitly noted below,
65 returns a consistent snapshot of the data requested.
66 Consistency is obtained by locking the destination
67 buffer into memory so that the data may be copied out without blocking.
70 are serialized to avoid deadlock.
72 The state is described using a
73 .Dq Management Information Base (MIB)
78 length array of integers.
82 function accepts an ASCII representation of the name and internally
83 looks up the integer name vector. Apart from that, it behaves the same
88 The information is copied into the buffer specified by
90 The size of the buffer is given by the location specified by
93 and that location gives the amount of data copied after a successful call
94 and after a call that returns with the error code
96 If the amount of data available is greater
97 than the size of the buffer supplied,
98 the call supplies as much data as fits in the buffer provided
99 and returns with the error code
101 If the old value is not desired,
105 should be set to NULL.
107 The size of the available data can be determined by calling
109 with a NULL parameter for
111 The size of the available data will be returned in the location pointed to by
113 For some operations, the amount of space may change often.
114 For these operations,
115 the system attempts to round up so that the returned size is
116 large enough for a call to return the data shortly thereafter.
120 is set to point to a buffer of length
122 from which the requested value is to be taken.
123 If a new value is not to be set,
125 should be set to NULL and
131 function accepts an ASCII representation of the name,
132 looks up the integer name vector,
133 and returns the numeric representation in the mib array pointed to by
135 The number of elements in the mib array is given by the location specified by
138 and that location gives the number of entries copied after a successful call.
143 may be used in subsequent
145 calls to get the data associated with the requested ASCII name.
146 This interface is intended for use by applications that want to
147 repeatedly request the same variable (the
149 function runs in about a third the time as the same request made via the
154 function is also useful for fetching mib prefixes and then adding
156 For example, to fetch process information
157 for processes with pid's less than 100:
159 .Bd -literal -offset indent -compact
162 struct kinfo_proc kp;
164 /* Fill out the first three components of the mib */
166 sysctlnametomib("kern.proc.pid", mib, &len);
168 /* Fetch and print entries for pid's < 100 */
169 for (i = 0; i < 100; i++) {
172 if (sysctl(mib, 4, &kp, &len, NULL, 0) == -1)
179 The top level names are defined with a CTL_ prefix in
182 The next and subsequent levels down are found in the include files
183 listed here, and described in separate sections below.
184 .Bl -column CTLXMACHDEPXXX "Next level namesXXXXXX" -offset indent
185 .It Sy "Name" Ta Sy "Next level names" Ta Sy "Description"
186 .It Dv CTL_DEBUG Ta "sys/sysctl.h" Ta "Debugging"
187 .It Dv CTL_VFS Ta "sys/mount.h" Ta "Filesystem"
188 .It Dv CTL_HW Ta "sys/sysctl.h" Ta "Generic CPU, I/O"
189 .It Dv CTL_KERN Ta "sys/sysctl.h" Ta "High kernel limits"
190 .It Dv CTL_MACHDEP Ta "sys/sysctl.h" Ta "Machine dependent"
191 .It Dv CTL_NET Ta "sys/socket.h" Ta "Networking"
192 .It Dv CTL_USER Ta "sys/sysctl.h" Ta "User-level"
193 .It Dv CTL_VM Ta "vm/vm_param.h" Ta "Virtual memory"
196 For example, the following retrieves the maximum number of processes allowed
199 .Bd -literal -offset indent -compact
204 mib[1] = KERN_MAXPROC;
205 len = sizeof(maxproc);
206 sysctl(mib, 2, &maxproc, &len, NULL, 0);
209 To retrieve the standard search path for the system utilities:
211 .Bd -literal -offset indent -compact
217 mib[1] = USER_CS_PATH;
218 sysctl(mib, 2, NULL, &len, NULL, 0);
220 sysctl(mib, 2, p, &len, NULL, 0);
223 The debugging variables vary from system to system.
224 A debugging variable may be added or deleted without need to recompile
229 gets the list of debugging variables from the kernel and
230 displays their current values.
231 The system defines twenty
237 They are declared as separate variables so that they can be
238 individually initialized at the location of their associated variable.
239 The loader prevents multiple use of the same variable by issuing errors
240 if a variable is initialized in more than one place.
241 For example, to export the variable
243 as a debugging variable, the following declaration would be used:
244 .Bd -literal -offset indent -compact
245 int dospecialcheck = 1;
246 struct ctldebug debug5 = { "dospecialcheck", &dospecialcheck };
249 A distinguished second level name, VFS_GENERIC,
250 is used to get general information about all filesystems.
251 One of its third level identifiers is VFS_MAXTYPENUM
252 that gives the highest valid filesystem type number.
253 Its other third level identifier is VFS_CONF that
254 returns configuration information about the filesystem
255 type given as a fourth level identifier (see
257 as an example of its use).
258 The remaining second level identifiers are the
259 filesystem type number returned by a
261 call or from VFS_CONF.
262 The third level identifiers available for each filesystem
263 are given in the header file that defines the mount
264 argument structure for that filesystem.
266 The string and integer information available for the
270 The changeable column shows whether a process with appropriate
271 privilege may change the value.
272 .Bl -column "Second level nameXXXXXX" integerXXX -offset indent
273 .It Sy "Second level name" Ta Sy "Type" Ta Sy "Changeable"
274 .It Dv HW_MACHINE Ta "string" Ta "no"
275 .It Dv HW_MODEL Ta "string" Ta "no"
276 .It Dv HW_NCPU Ta "integer" Ta "no"
277 .It Dv HW_BYTEORDER Ta "integer" Ta "no"
278 .It Dv HW_PHYSMEM Ta "integer" Ta "no"
279 .It Dv HW_USERMEM Ta "integer" Ta "no"
280 .It Dv HW_PAGESIZE Ta "integer" Ta "no"
281 .It Dv HW_FLOATINGPT Ta "integer" Ta "no"
282 .It Dv HW_MACHINE_ARCH Ta "string" Ta "no"
283 .It Dv HW_MACHINE_PLATFORM Ta "string" Ta "no"
284 .\".It Dv HW_DISKNAMES Ta "integer" Ta "no"
285 .\".It Dv HW_DISKSTATS Ta "integer" Ta "no"
286 .It Dv HW_SENSORS Ta "node" Ta "not applicable"
296 The byteorder (4321, or 1234).
298 The bytes of physical memory.
300 The bytes of non-kernel memory.
302 The software page size.
304 Nonzero if the floating point support is in hardware.
305 .It Dv HW_MACHINE_ARCH
306 The machine dependent architecture type.
307 .It Dv HW_MACHINE_PLATFORM
308 The platform architecture type.
309 .\".It Dv HW_DISKNAMES
310 .\".It Dv HW_DISKSTATS
312 Third level comprises an array of
313 .Vt "struct sensordev"
314 structures containing information about devices
315 that may attach hardware monitoring sensors.
317 Third, fourth and fifth levels together comprise an array of
319 structures containing snapshot readings of hardware monitoring sensors.
320 In such usage, third level indicates the numerical representation
321 of the sensor device name to which the sensor is attached
324 and number shall be matched with the help of
325 .Vt "struct sensordev"
327 fourth level indicates sensor type and
328 fifth level is an ordinal sensor number (unique to
329 the specified sensor type on the specified sensor device).
343 The string and integer information available for the
347 The changeable column shows whether a process with appropriate
348 privilege may change the value.
349 The types of data currently available are process information,
350 system vnodes, the open file entries, routing table entries,
351 virtual memory statistics, load average history, and clock rate
353 .Bl -column "KERNXMAXPOSIXLOCKSPERUIDXXX" "struct clockrateXXX" -offset indent
354 .It Sy "Second level name" Ta Sy "Type" Ta Sy "Changeable"
355 .It Dv KERN_ARGMAX Ta "integer" Ta "no"
356 .It Dv KERN_BOOTFILE Ta "string" Ta "yes"
357 .It Dv KERN_BOOTTIME Ta "struct timespec" Ta "no"
358 .It Dv KERN_CLOCKRATE Ta "struct clockinfo" Ta "no"
359 .It Dv KERN_FILE Ta "struct kinfo_file" Ta "no"
360 .It Dv KERN_HOSTID Ta "integer" Ta "yes"
361 .It Dv KERN_HOSTNAME Ta "string" Ta "yes"
362 .It Dv KERN_JOB_CONTROL Ta "integer" Ta "no"
363 .It Dv KERN_MAXFILES Ta "integer" Ta "yes"
364 .It Dv KERN_MAXFILESPERPROC Ta "integer" Ta "yes"
365 .It Dv KERN_MAXPOSIXLOCKSPERUID Ta "integer" Ta "yes"
366 .It Dv KERN_MAXPROC Ta "integer" Ta "no"
367 .It Dv KERN_MAXPROCPERUID Ta "integer" Ta "yes"
368 .It Dv KERN_MAXVNODES Ta "integer" Ta "yes"
369 .It Dv KERN_NGROUPS Ta "integer" Ta "no"
370 .It Dv KERN_NISDOMAINNAME Ta "string" Ta "yes"
371 .It Dv KERN_OSRELDATE Ta "integer" Ta "no"
372 .It Dv KERN_OSRELEASE Ta "string" Ta "no"
373 .It Dv KERN_OSREV Ta "integer" Ta "no"
374 .It Dv KERN_OSTYPE Ta "string" Ta "no"
375 .It Dv KERN_POSIX1 Ta "integer" Ta "no"
376 .It Dv KERN_PROC Ta "struct kinfo_proc" Ta "no"
377 .It Dv KERN_PROF Ta "node" Ta "not applicable"
378 .It Dv KERN_SAVED_IDS Ta "integer" Ta "no"
379 .It Dv KERN_SECURELVL Ta "integer" Ta "raise only"
380 .It Dv KERN_VERSION Ta "string" Ta "no"
381 .It Dv KERN_VNODE Ta "struct vnode" Ta "no"
385 The maximum bytes of argument to
388 The full pathname of the file from which the kernel was loaded.
392 structure is returned.
393 This structure contains the time that the system was booted.
394 .It Dv KERN_CLOCKRATE
397 structure is returned.
398 This structure contains the clock, statistics clock and profiling clock
399 frequencies, the number of micro-seconds per hz tick and the skew rate.
401 Return the entire file table.
402 The returned data consists of an array of
403 .Vt struct kinfo_file ,
404 whose size depends on the current number of such objects in the system.
406 Get or set the host id.
408 Get or set the hostname.
409 .It Dv KERN_JOB_CONTROL
410 Return 1 if job control is available on this system, otherwise 0.
412 The maximum number of files that may be open in the system.
413 .It Dv KERN_MAXFILESPERPROC
414 The maximum number of files that may be open for a single process.
415 This limit only applies to processes with an effective uid of nonzero
416 at the time of the open request.
417 Files that have already been opened are not affected if the limit
418 or the effective uid is changed.
420 The maximum number of concurrent processes the system will allow.
421 .It Dv KERN_MAXPROCPERUID
422 The maximum number of concurrent processes the system will allow
423 for a single effective uid.
424 This limit only applies to processes with an effective uid of nonzero
425 at the time of a fork request.
426 Processes that have already been started are not affected if the limit
428 .It Dv KERN_MAXVNODES
429 The maximum number of vnodes available on the system.
431 The maximum number of supplemental groups.
432 .It Dv KERN_NISDOMAINNAME
433 The name of the current YP/NIS domain.
434 .It Dv KERN_OSRELDATE
435 The system release date in YYYYMM format
436 (January 1996 is encoded as 199601).
437 .It Dv KERN_OSRELEASE
438 The system release string.
440 The system revision string.
442 The system type string.
446 with which the system
449 Return selected information about specific running processes.
451 For the following names, an array of
452 .Vt struct kinfo_proc
453 structures is returned,
454 whose size depends on the current number of such objects in the system.
456 .Dv KERN_PROC_FLAG_LWP
457 to the third level name signals that information about all
458 light weight processes of the selected processes should be returned.
459 .Bl -column "Third level nameXXXXXX" "Fourth level is:XXXXXX" -offset indent
460 .It Sy "Third level name" Ta Sy "Fourth level is:"
461 .It Dv KERN_PROC_ALL Ta "None"
462 .It Dv KERN_PROC_PID Ta "A process ID"
463 .It Dv KERN_PROC_PGRP Ta "A process group"
464 .It Dv KERN_PROC_TTY Ta "A tty device"
465 .It Dv KERN_PROC_UID Ta "A user ID"
466 .It Dv KERN_PROC_RUID Ta "A real user ID"
469 For the following names, a NUL-terminated string is returned.
470 .Bl -column "Third level nameXXXXXX" "Fourth level is:XXXXXX" -offset indent
471 .It Sy "Third level name" Ta Sy "Fourth level is:"
472 .It Dv KERN_PROC_ARGS Ta "A process ID"
473 .It Dv KERN_PROC_CWD Ta "A process ID"
474 .It Dv KERN_PROC_PATHNAME Ta "A process ID"
477 The variables are as follows:
479 .It Dv KERN_PROC_ARGS
480 Returns the command line argument array of a process, in a flattened form,
481 i.e. NUL-terminated arguments follow each other.
482 A process can set its own process title by changing this value.
484 Returns the current working directory of a process.
485 .It Dv KERN_PROC_PATHNAME
486 Returns the path of a process' text file.
489 implies the current process.
492 Return profiling information about the kernel.
493 If the kernel is not compiled for profiling,
494 attempts to retrieve any of the
499 The third level names for the string and integer profiling information
501 The changeable column shows whether a process with appropriate
502 privilege may change the value.
503 .Bl -column "GPROFXGMONPARAMXXX" "struct gmonparamXXX" -offset indent
504 .It Sy "Third level name" Ta Sy "Type" Ta Sy "Changeable"
505 .It Dv GPROF_STATE Ta "integer" Ta "yes"
506 .It Dv GPROF_COUNT Ta "u_short[]" Ta "yes"
507 .It Dv GPROF_FROMS Ta "u_short[]" Ta "yes"
508 .It Dv GPROF_TOS Ta "struct tostruct" Ta "yes"
509 .It Dv GPROF_GMONPARAM Ta "struct gmonparam" Ta "no"
512 The variables are as follows:
519 to show that profiling is running or stopped.
521 Array of statistical program counter counts.
523 Array indexed by program counter of call-from points.
527 describing destination of calls and their counts.
528 .It Dv GPROF_GMONPARAM
529 Structure giving the sizes of the above arrays.
531 .It Dv KERN_SAVED_IDS
532 Returns 1 if saved set-group and saved set-user ID is available.
533 .It Dv KERN_SECURELVL
534 The system security level.
535 This level may be raised by processes with appropriate privilege.
536 It may not be lowered.
538 The system version string.
540 Return the entire vnode table.
541 Note, the vnode table is not necessarily a consistent snapshot of
543 The returned data consists of an array whose size depends on the
544 current number of such objects in the system.
545 Each element of the array contains the kernel address of a vnode
547 followed by the vnode itself
551 The set of variables defined is architecture dependent.
552 The following variables are defined for the x86_64 architecture.
553 .Bl -column "CONSOLE_DEVICEXXX" "struct bootinfoXXX" -offset indent
554 .It Sy "Second level name" Ta Sy "Type" Ta Sy "Changeable"
555 .It Dv CPU_CONSDEV Ta "dev_t" Ta "no"
556 .It Dv CPU_ADJKERNTZ Ta "int" Ta "yes"
557 .It Dv CPU_DISRTCSET Ta "int" Ta "yes"
558 .It Dv CPU_BOOTINFO Ta "struct bootinfo" Ta "no"
559 .It Dv CPU_WALLCLOCK Ta "int" Ta "yes"
562 The string and integer information available for the
564 level is detailed below.
565 The changeable column shows whether a process with appropriate
566 privilege may change the value.
567 .Bl -column "Second level nameXXXXXX" "routing messagesXXX" -offset indent
568 .It Sy "Second level name" Ta Sy "Type" Ta Sy "Changeable"
569 .It Dv PF_ROUTE Ta "routing messages" Ta "no"
570 .It Dv PF_INET Ta "IPv4 values" Ta "yes"
571 .It Dv PF_INET6 Ta "IPv6 values" Ta "yes"
575 Return the entire routing table or a subset of it.
576 The data is returned as a sequence of routing messages (see
578 for the header file, format and meaning).
579 The length of each message is contained in the message header.
581 The third level name is a protocol number, which is currently always 0.
582 The fourth level name is an address family, which may be set to 0 to
583 select all address families.
584 The fifth and sixth level names are as follows:
585 .Bl -column "Fifth level nameXXXXXX" "Sixth level is:XXX" -offset indent
586 .It Sy "Fifth level name" Ta Sy "Sixth level is:"
587 .It Dv NET_RT_FLAGS Ta "rtflags"
588 .It Dv NET_RT_DUMP Ta "None"
589 .It Dv NET_RT_IFLIST Ta "None"
592 Get or set various global information about the IPv4
593 .Pq Internet Protocol version 4 .
594 The third level name is the protocol.
595 The fourth level name is the variable name.
596 The currently defined protocols and names are:
597 .Bl -column ProtocolXX VariableXX TypeXX ChangeableXX
598 .It Sy "Protocol" Ta Sy "Variable" Ta Sy "Type" Ta Sy "Changeable"
599 .It icmp Ta bmcastecho Ta integer Ta yes
600 .It icmp Ta maskrepl Ta integer Ta yes
601 .It ip Ta forwarding Ta integer Ta yes
602 .It ip Ta redirect Ta integer Ta yes
603 .It ip Ta ttl Ta integer Ta yes
604 .It udp Ta checksum Ta integer Ta yes
607 The variables are as follows:
609 .It Li icmp.bmcastecho
610 Returns 1 if an ICMP echo request to a broadcast or multicast address is
613 Returns 1 if ICMP network mask requests are to be answered.
615 Returns 1 when IP forwarding is enabled for the host,
616 meaning that the host is acting as a router.
618 Returns 1 when ICMP redirects may be sent by the host.
619 This option is ignored unless the host is routing IP packets,
620 and should normally be enabled on all systems.
622 The maximum time-to-live (hop count) value for an IP packet sourced by
624 This value applies to normal transport protocols, not to ICMP.
626 Returns 1 when UDP checksums are being computed and checked.
627 Disabling UDP checksums is strongly discouraged.
629 For variables net.inet.*.ipsec, please refer to
633 Get or set various global information about IPv6
634 .Pq Internet Protocol version 6 .
635 The third level name is the protocol.
636 The fourth level name is the variable name.
643 .Li net.inet6.*.ipsec6 ,
648 The string and integer information available for the
650 level is detailed below.
651 The changeable column shows whether a process with appropriate
652 privilege may change the value.
653 .Bl -column "USER_COLL_WEIGHTS_MAXXXX" "integerXXX" -offset indent
654 .It Sy "Second level name" Ta Sy "Type" Ta Sy "Changeable"
655 .It Dv USER_BC_BASE_MAX Ta integer Ta no
656 .It Dv USER_BC_DIM_MAX Ta integer Ta no
657 .It Dv USER_BC_SCALE_MAX Ta integer Ta no
658 .It Dv USER_BC_STRING_MAX Ta integer Ta no
659 .It Dv USER_COLL_WEIGHTS_MAX Ta integer Ta no
660 .It Dv USER_CS_PATH Ta string Ta no
661 .It Dv USER_EXPR_NEST_MAX Ta integer Ta no
662 .It Dv USER_LINE_MAX Ta integer Ta no
663 .It Dv USER_POSIX2_CHAR_TERM Ta integer Ta no
664 .It Dv USER_POSIX2_C_BIND Ta integer Ta no
665 .It Dv USER_POSIX2_C_DEV Ta integer Ta no
666 .It Dv USER_POSIX2_FORT_DEV Ta integer Ta no
667 .It Dv USER_POSIX2_FORT_RUN Ta integer Ta no
668 .It Dv USER_POSIX2_LOCALEDEF Ta integer Ta no
669 .It Dv USER_POSIX2_SW_DEV Ta integer Ta no
670 .It Dv USER_POSIX2_UPE Ta integer Ta no
671 .It Dv USER_POSIX2_VERSION Ta integer Ta no
672 .It Dv USER_RE_DUP_MAX Ta integer Ta no
673 .It Dv USER_STREAM_MAX Ta integer Ta no
674 .It Dv USER_TZNAME_MAX Ta integer Ta no
677 .It Dv USER_BC_BASE_MAX
678 The maximum ibase/obase values in the
681 .It Dv USER_BC_DIM_MAX
682 The maximum array size in the
685 .It Dv USER_BC_SCALE_MAX
686 The maximum scale value in the
689 .It Dv USER_BC_STRING_MAX
690 The maximum string length in the
693 .It Dv USER_COLL_WEIGHTS_MAX
694 The maximum number of weights that can be assigned to any entry of the
696 order keyword in the locale definition file.
698 Return a value for the
700 environment variable that finds all the standard utilities.
701 .It Dv USER_EXPR_NEST_MAX
702 The maximum number of expressions that can be nested within
707 The maximum length in bytes of a text-processing utility's input line.
708 .It Dv USER_POSIX2_CHAR_TERM
709 Return 1 if the system supports at least one terminal type capable of
710 all operations described in
713 .It Dv USER_POSIX2_C_BIND
714 Return 1 if the system's C-language development facilities support the
715 C-Language Bindings Option, otherwise 0.
716 .It Dv USER_POSIX2_C_DEV
717 Return 1 if the system supports the C-Language Development Utilities Option,
719 .It Dv USER_POSIX2_FORT_DEV
720 Return 1 if the system supports the FORTRAN Development Utilities Option,
722 .It Dv USER_POSIX2_FORT_RUN
723 Return 1 if the system supports the FORTRAN Runtime Utilities Option,
725 .It Dv USER_POSIX2_LOCALEDEF
726 Return 1 if the system supports the creation of locales, otherwise 0.
727 .It Dv USER_POSIX2_SW_DEV
728 Return 1 if the system supports the Software Development Utilities Option,
730 .It Dv USER_POSIX2_UPE
731 Return 1 if the system supports the User Portability Utilities Option,
733 .It Dv USER_POSIX2_VERSION
736 with which the system attempts to comply.
737 .It Dv USER_RE_DUP_MAX
738 The maximum number of repeated occurrences of a regular expression
739 permitted when using interval notation.
740 .It Dv USER_STREAM_MAX
741 The minimum maximum number of streams that a process may have open
743 .It Dv USER_TZNAME_MAX
744 The minimum maximum number of types supported for the name of a timezone.
747 The string and integer information available for the
749 level is detailed below.
750 The changeable column shows whether a process with appropriate
751 privilege may change the value.
752 .Bl -column "Second level nameXXXXXX" "struct loadavgXXX" -offset indent
753 .It Sy "Second level name" Ta Sy "Type" Ta Sy "Changeable"
754 .It Dv VM_LOADAVG Ta struct loadavg Ta no
755 .It Dv VM_METER Ta struct vmtotal Ta no
756 .It Dv VM_PAGEOUT_ALGORITHM Ta integer Ta yes
757 .It Dv VM_SWAPPING_ENABLED Ta integer Ta maybe
758 .It Dv VM_V_CACHE_MAX Ta integer Ta yes
759 .It Dv VM_V_CACHE_MIN Ta integer Ta yes
760 .It Dv VM_V_FREE_MIN Ta integer Ta yes
761 .It Dv VM_V_FREE_RESERVED Ta integer Ta yes
762 .It Dv VM_V_FREE_TARGET Ta integer Ta yes
763 .It Dv VM_V_INACTIVE_TARGET Ta integer Ta yes
764 .It Dv VM_V_PAGEOUT_FREE_MIN Ta integer Ta yes
768 Return the load average history.
769 The returned data consists of a
772 Return the system wide virtual memory statistics.
773 The returned data consists of a
775 .It Dv VM_PAGEOUT_ALGORITHM
776 0 if the statistics-based page management algorithm is in use
777 or 1 if the near-LRU algorithm is in use.
778 .It Dv VM_SWAPPING_ENABLED
779 1 if process swapping is enabled or 0 if disabled. This variable is
780 permanently set to 0 if the kernel was built with swapping disabled.
781 .It Dv VM_V_CACHE_MAX
782 Maximum desired size of the cache queue.
783 .It Dv VM_V_CACHE_MIN
784 Minimum desired size of the cache queue. If the cache queue size
785 falls very far below this value, the pageout daemon is awakened.
787 Minimum amount of memory (cache memory plus free memory)
788 required to be available before a process waiting on memory will be
790 .It Dv VM_V_FREE_RESERVED
791 Processes will awaken the pageout daemon and wait for memory if the
792 number of free and cached pages drops below this value.
793 .It Dv VM_V_FREE_TARGET
794 The total amount of free memory (including cache memory) that the
795 pageout daemon tries to maintain.
796 .It Dv VM_V_INACTIVE_TARGET
797 The desired number of inactive pages that the pageout daemon should
798 achieve when it runs. Inactive pages can be quickly inserted into
799 process address space when needed.
800 .It Dv VM_V_PAGEOUT_FREE_MIN
801 If the amount of free and cache memory falls below this value, the
802 pageout daemon will enter "memory conserving mode" to avoid deadlock.
807 .Bl -tag -width ".In netinet/icmp_var.h" -compact
809 definitions for top level identifiers, second level kernel and hardware
810 identifiers, and user level identifiers
812 definitions for second level network identifiers
814 definitions for third level profiling identifiers
816 definitions for second level virtual memory identifiers
818 definitions for third level IPv4/IPv6 identifiers and
819 fourth level IPv4/v6 identifiers
820 .It In netinet/icmp_var.h
821 definitions for fourth level ICMP identifiers
822 .It In netinet/icmp6.h
823 definitions for fourth level ICMPv6 identifiers
824 .It In netinet/udp_var.h
825 definitions for fourth level UDP identifiers
828 The following errors may be reported:
837 contains an invalid address.
841 array is less than two or greater than
846 is given and its specified length in
848 is too large or too small.
850 The length pointed to by
852 is too short to hold the requested value.
856 array specifies an intermediate rather than terminal name.
860 array specifies a terminal name, but the actual name is not terminal.
864 array specifies a value that is unknown.
866 An attempt is made to set a read-only value.
868 A process without appropriate privilege attempts to set a value.
876 function first appeared in