? ? ? ?GNU C 函數庫是一種類似于第三方插件的東西。由于 Linux 是用 C 語言寫的,所以 Linux 的一些操作是用 C 語言實現的,因此,GUN 組織開發了一個 C 語言的庫?以便讓我們更好的利用 C 語言開發基于 Linux 操作系統的程序。不過現在的不同的 Linux 的發行版本對這兩個函數庫有不同的處理方法,有的可能已經集成在同一個庫里了。?
glibc下載地址:http://mirror.hust.edu.cn/gnu/
glibc是linux下面c標準庫的實現,即GNU C Library。glibc本身是GNU旗下的C標準庫,后來逐漸成為了Linux的標準c庫,而Linux下原來的標準c庫Linux libc逐漸不再被維護。Linux下面的標準c庫不僅有這一個,如uclibc(https://www.uclibc.org/)、klibc,以及上面被提到的Linux libc,但是glibc無疑是用得最多的。glibc在/lib目錄下的.so文件為libc.so.6。
?
查看當前系統的 glibc 版本的兩種方法:? 1.
01
[root@Betty ~]# /lib/libc.so.6
02
GNU C Library stable release version 2.5, by Roland McGrath et al.
03
Copyright (C) 2006 Free Software Foundation, Inc.
04
This is?free?software; see the?source?for?copying conditions.
05
There is NO warranty; not even?for?MERCHANTABILITY or FITNESS FOR A
06
PARTICULAR PURPOSE.
07
Compiled by GNU CC version 4.1.2 20080704 (Red Hat 4.1.2-52).
08
Compiled on a Linux 2.6.9 system on 2013-01-08.
09
Available extensions:
10
????????The C stubs add-on version 2.1.2.
11
????????crypt add-on version 2.1 by Michael Glad and others
12
????????GNU Libidn by Simon Josefsson
13
????????GNU libio by Per Bothner
14
????????NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
15
????????Native POSIX Threads Library by Ulrich Drepper et al
16
????????BIND-8.2.3-T5B
17
????????RT using linux kernel aio
18
Thread-local?storage support included.
19
For bug reporting instructions, please see:
20
<http://www.gnu.org/software/libc/bugs.html>.
21
[root@Betty ~]#
2.?
1
[root@Betty ~]# ldd? --version
2
ldd (GNU libc) 2.5
3
Copyright (C) 2006 Free Software Foundation, Inc.
4
This is?free?software; see the?source?for?copying conditions.? There is NO
5
warranty; not even?for?MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
6
Written by Roland McGrath and Ulrich Drepper.
?
7
[root@Betty ~]# ?
?
Glibc?
Overview:? Any Unix-like operating system needs a C library: the library which defines the ``system calls'' and other basic facilities such as open, malloc, printf, exit...? The GNU C Library is used as the C library in the GNU systems and most systems with the Linux kernel.
Project Goals:?? The GNU C Library is primarily designed to be a portable and high performance C library. It follows all relevant standards including ISO C11 and POSIX.1-2008. It is also internationalized and has one of the most complete internationalization interfaces known.
History:? The history of Unix and various standards determine much of the interface of the C library. In general the GNU C Library supports the ISO C and POSIX standards. We also try to support the features of popular Unix variants (including BSD and System V) when those do not conflict with the standards. Different compatibility modes (selectable when you compile an application) allow the peaceful coexistence of compatibility support for different varieties of Unix.?