查询Linux系统中glibc的版本
2015-10-23 15:28
621 查看
编写一个简单的程序
编译
查看glibc的位置
在我的机器上显示
直接运行glibc共享库文件查看版本
在我的机器上显示
还可以在运行时获取版本信息,使用API gnu_get_libc_version():
运行后显示:
#include <stdio.h> int main() { printf("Hello world\n"); return 0; }
编译
gcc test.c
查看glibc的位置
ldd a.out | grep libc
在我的机器上显示
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb757a000)
直接运行glibc共享库文件查看版本
$ /lib/i386-linux-gnu/libc.so.6
在我的机器上显示
GNU C Library (Ubuntu EGLIBC 2.15-0ubuntu20) stable release version 2.15, by Roland McGrath et al. Copyright (C) 2012 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. Compiled by GNU CC version 4.6.3 20120918 (prerelease). Compiled on a Linux 3.5.4 system on 2012-10-04. Available extensions: crypt add-on version 2.1 by Michael Glad and others GNU Libidn by Simon Josefsson 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.debian.org/Bugs/>.
还可以在运行时获取版本信息,使用API gnu_get_libc_version():
#include <stdio.h> #include <gnu/libc-version.h> int main() { printf("libc version : %s\n", gnu_get_libc_version()); return 0; }
运行后显示:
libc version : 2.15
相关文章推荐
- vmlinux.lds
- CentOS 6.2 Eclipse CDT 开发环境搭建
- linux中使用root权限都删除不了的文件该怎办?
- 【学习/研发】嵌入式Linux/Android开发有它就够了——迅为4412开发板
- linux c utf8和GBK 的转换函数
- centos nodejs安装
- Linux内核中的红黑树
- Linux 修改时区的方法。centos ,Debian 有效
- 【Linux高频命令专题(22)】gzip
- Centos 6.5 安装Xrdp 远程桌面
- linux后台开发常用调试工具
- Linux 命令 - ss: 查看套接字统计信息
- linux下Ftp服务安装
- Linux diff与patch的深入分析
- Linux设置默认启动命令行,而不是图形界面
- Linux内存调试工具—Valgrind
- Linux服务器性能测试工具介绍
- Linux 服务器运维实用命令
- Linux下添加任务计划,计划内容以sh文件表示
- linux备份文件夹