-
函数原型
long sysconf(int name);
-
头文件
#include <unistd.h>
-
描述
get configurable system variables.
This interface is defined by IEEE Std 1003.1-1988 (``POSIX.1’’). A far more complete interface is available using sysctl(3).
The sysconf() function provides a method for applications to determine the current value of a configurable system limit or option variable. The name argument specifies the system variable to be queried. Symbolic constants for each name value are found in the include file <unistd.h>. Shell programmers who need access to these parameters should use the getconf(1) utility.
主要是来获取系统变量的。
-
参数
_SC_ARG_MAX The maximum bytes of argument to execve(2). _SC_CHILD_MAX The maximum number of simultaneous processes per user id. _SC_CLK_TCK The frequency of the statistics clock in ticks per second. _SC_IOV_MAX The maximum number of elements in the I/O vector used by readv(2), writev(2), recvmsg(2), and sendmsg(2). _SC_NGROUPS_MAX The maximum number of supplemental groups. _SC_NPROCESSORS_CONF The number of processors configured. _SC_NPROCESSORS_ONLN The number of processors currently online. _SC_OPEN_MAX The maximum number of open files per user id. _SC_PAGESIZE The size of a system page in bytes. _SC_STREAM_MAX The minimum maximum number of streams that a process may have
Linux sysconf函数 -- get configurable system variables
最新推荐文章于 2024-02-22 14:36:45 发布
sysconf函数用于获取Linux系统的可配置系统限制或选项变量的当前值。它定义在POSIX.1标准中,通过<unistd.h>头文件中的符号常量指定查询的系统变量。当调用不成功时,返回-1并设置errno;如果变量关联的功能不受支持,也会返回-1,但errno不修改。成功则返回变量的当前值。
摘要由CSDN通过智能技术生成