Linux從用戶層到內核層系列 - GNU系列之glibc介紹

Hanks.Wang - 專注操作系統與移動安全,Linux/SELinux/SEAndroid/TrustZone/Encription/MDM    Mail - [email protected]


GNU系列之glibc介紹

最近寫程序的時候突然想到一個問題,我們在做內核開發的時候很少使用到C庫函數,在linux kernel中使用到C庫的幾個重要的地方如系統啓動時候的標準輸入輸出,scsi驅動部分還有就是linux/tools。我們修改內核代碼的時候都使用內核自身提供的函數接口或者變量,我們可以直接調用系統提供的API,在我們做應用層開發的時候我們卻大量的使用了libc,libc和內核開發出來的接口是如何銜接起來的呢?libc對kernel提供的接口是如何封裝的?從用戶層調用的libc如何映射到系統中斷向量表中?glibc系列文章將逐一弄明白這寫問題。磨刀不誤砍柴功,首先從glibc說起。

說明:對於glibc的介紹沒有比GNU官方Web介紹更爲簡潔和明瞭的了。由於原文沒有太難的英文詞彙和複雜的語法,就不再翻譯了。

文章引用自GNU官網:http://www.gnu.org/software/libc/index.html

    Glibc的API開發手冊和函數的詳細說明: http://www.gnu.org/software/libc/manual/

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 aportable 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.

Current Status

The current stable version of glibc is 2.17. See the NEWS file in the glibc sources for more information.

Latest News

2012-12-25: glibc 2.17 released.

2012-06-30: glibc 2.16 released.

2012-03-21: glibc 2.15 released.

2011-06-07: glibc 2.14 released.

2011-02-04: glibc 2.13 released.

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.

People

The GNU C Library is currently maintained by a community of developers many of which are listed on the MAINTAINERS page of the project wiki.

Many others have contributed in large amounts as documented in the glibc Contributors.

Thank you to all who have contributed, either in bug reports, or by answering a question, your help is appreciated.


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章