当前位置: 技术问答>linux和unix
有人知道如何用C程序查询当前运行机器的glibc版本么?
来源: 互联网 发布时间:2016-06-14
本文导语: 目前碰到这么个问题... 不允许调用shell去取,也不让用外部设置环境变量。 没查到什么库函数或者宏能够用,有没有了解些的? 谢了啊 | 摘的 To discover which kind of system you have, (remember, these inst...
目前碰到这么个问题...
不允许调用shell去取,也不让用外部设置环境变量。
没查到什么库函数或者宏能够用,有没有了解些的?
谢了啊
不允许调用shell去取,也不让用外部设置环境变量。
没查到什么库函数或者宏能够用,有没有了解些的?
谢了啊
|
摘的
To discover which kind of system you have, (remember, these instructions
are for x86 based Linux only): ls -l /lib/libc.so.* What you are looking
for is lines of the form /lib/libc.so. If all you see are lines where
is 5, then you have libc5. If you
have a line where is 6, then you have glibc, and you should get the
glibc version. An additional check is to look in /lib for libdl.so.:
if at least one here is 2, then you definitely have a glibc system.
And than
rpm -q glibc
You will get glibc version number.
To discover which kind of system you have, (remember, these instructions
are for x86 based Linux only): ls -l /lib/libc.so.* What you are looking
for is lines of the form /lib/libc.so. If all you see are lines where
is 5, then you have libc5. If you
have a line where is 6, then you have glibc, and you should get the
glibc version. An additional check is to look in /lib for libdl.so.:
if at least one here is 2, then you definitely have a glibc system.
And than
rpm -q glibc
You will get glibc version number.