日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > windows >内容正文

windows

查看当前系统的glibc版本

發布時間:2024/1/23 windows 51 豆豆
生活随笔 收集整理的這篇文章主要介紹了 查看当前系统的glibc版本 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

有時我們經常需要查看當前系統的glibc版本,可以這樣查看:

/lib/libc.so.6

有時:/lib/x86-64-linux/libc.so.6

把這個文件當命令執行一下

為什么這個庫可以直接run呢?原來在libc的代碼中有一點小手腳:

Makerules:586:LDFLAGS-c.so += -e __libc_main csu/version.c:71:__libc_main(void) void __libc_main(void) {__libc_print_version();_exit(0); }

或者:

因為ldd命令也是glibc提供的,所以也能查看

ldd --version

glibc是什么,以及與gcc的關系?

glibc是gnu發布的libc庫,也即c運行庫。glibc是linux系統中最底層的api(應用程序開發接口),幾乎其他任何的運行庫都會依賴于glibc。glibc除了封裝linux操作系統所提供的系統服務外,它本身也提供了許多其它一些必要功能服務的實現,主要的如下:

(1) string,字符串處理

(2) signal, 信號處理

(3) dlfcn, 管理共享庫的動態加載

(4) direct,文件目錄操作

(5) elf, 共享庫的動態加載器,也即interpreter

(6) iconv,不同字符集的編碼轉換

(7) inet, socket接口的實現

(8) intl, 國際化,也即gettext的實現

(9) io

(10) linuxthreads

(11) locale, 本地化

(12) login, 虛擬終端設備的管理,及系統的安全訪問

(13) malloc,動態內存的分配和管理

(14) nis

(15) stdlib, 其他基本功能

gcc是編譯器,基本上Linux下所有的程序(包括內核)都是gcc編譯的,libc當然也是。

gcc和libc是互相依賴的兩個軟件,它們合作的方式類似Linux系統的“自舉”。先在一個可以運行的帶有老libc和gcc的系統上,用老gcc編譯出一個新版本的gcc+老libc,再用這個新gcc編譯出一個新gcc+新libc,再用這套東西編譯整個新系統。

?

glibc版本查看:

4.9. How can I find out which version of glibc I am using in the moment?

{UD} If you want to find out about the version from the command line simply run the libc binary.

This is probably not possible on all platforms but where it is simply locate the libc DSO and start it as an application.

On Linux like /lib/libc.so.6 This will produce all the information you need. What always will work is to use the API

glibc provides. Compile and run the following little program to get the version information:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#include <stdio.h> #include <gnu/libc-version.h> int main (void) { puts (gnu_get_libc_version ()); return 0; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This interface can also obviously be used to perform tests at runtime if this should be necessary.

Just execute:

ldd --version

which comes with glibc package

轉自:https://my.oschina.net/acmfly/blog/77211

總結

以上是生活随笔為你收集整理的查看当前系统的glibc版本的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。