曲径通幽论坛

标题: getconf -- 打印系统配置变量 [打印本页]

作者: beyes    时间: 2012-1-3 19:11
标题: getconf -- 打印系统配置变量
getconf 打印出那些由 sysconf() 或 confstr() 函数所定义的变量值。可以通过 -a 选项查看所有可以获得预设变量值。

获取内存页大小:
$ getconf PAGE_SIZE
4096


获取一个子或 int 类型的位数,通过该值通常也可以判断系统是 32 位的还是 64 位的:
$ getconf WORD_BIT
32


获取 glib 版本号:
getconf GNU_LIBC_VERSION
glibc 2.14.1
获取 glib 更详细信息的方法是直接执行 /lib/libc.so.6 :
/lib/libc.so.6
GNU C Library stable release version 2.14.1 (20111007), by Roland McGrath et al.
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Configured for i686-suse-linux.
Compiled by GNU CC version 4.6.2.
Compiled on a Linux 3.1.0 system on 2011-12-09.
Available extensions:
    crypt add-on version 2.1 by Michael Glad and others
    GNU Libidn by Simon Josefsson
    NoVersion patch for broken glibc 2.0 binaries
    Native POSIX Threads Library by Ulrich Drepper et al
    BIND-8.2.3-T5B
libc ABIs: UNIQUE IFUNC
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.





欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) Powered by Discuz! X3.2