Ubuntu下查看glibc版本
在Ubuntu下查看glibc版本我知道的⽅法有两种: 第⽅种为:ldd --version,其输出如下。 ldd (Ubuntu EGLIBC 2.19-0ubuntu6.6) 2.19 Copyright (C) 2014 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.
Written by Roland McGrath and Ulrich Drepper.
第⽅种⽅法为:getconf GNU_LIBC_VERSION。输出结果为: glibc 2.19
由上可知glibc的版本为2.19.。
这两种⽅法都可以得到我们想要的结果。第⽅种⽅法只是通过输出ldd的版本号,间接地输出了glibc的版本;第⽅种⽅法就是⽅个很直接的⽅法得到glibc的版本。应该还有别的⽅法得到glibc的版本,如果知道后会继续添加上来。
以下是最新更新,第三种⽅法为通过编程得到glibc的版本。编写如下checklibcversion.c
#include #include int main(void) { puts (gnu_get_libc_version ()); return 0; } 然后编译⽅成⽅进制⽅件checklibcversion,最后执⽅./checklibcversion即可打印出libc的版本。 $./checklibcversion 2.17 ---------------------------- ubuntu下/usr/include/time.h头⽅件为glibc库安装的 因篇幅问题不能全部显示,请点此查看更多更全内容