glib与glibc的区别

来源:互联网 发布:阿达帕林对黑头知乎 编辑:程序博客网 时间:2024/05/17 09:18

今天在安装syslog-ng 3.0的时候说需要glib 2.12.3 以上的版本,想起还有一个glibc库,好像不太一样,上网搜了一下:

原文:http://hi.baidu.com/yuanfang/blog/item/85acd788af41c191a5c27208.html

GLib是Gtk +库和Gnome的基础。GLib可以在多个平台下使用,比如Linux、Unix、Windows等。GLib为许多标准的、常用的C语言结构提供了相应的替代物。
GLib中定义了好多有用的数据结构,如单(双)向连表,可变长的数组等,线程池等有用的东西。使用GLib库的程序都应该包含GLib的头文件glib.h。

Glibc 是提供系统调用和基本函数的 C 库,比如open, malloc, printf等等。所有动态连接的程序都要用到它。是GNU开发的C库。

他们之间在用途上没有太大关系。

GLib is a general-purpose utility library, which provides many useful data types, macros, type conversions, string utilities, file utilities, a main loop abstraction, and so on. It works on many UNIX-like platforms, Windows, OS/2 and BeOS. GLib is released under the GNU Library General Public License (GNU LGPL).

The general policy of GLib is that all functions are invisibly threadsafe with the exception of data structure manipulation functions, where, if you have two threads manipulating the same data structure, they must use a lock to synchronize their operation.

GLIBC

The GNU C library is primarily designed to be a portable and high performance C library.

It follows all relevant standards (ISO C 99, POSIX.1c, POSIX.1j, POSIX.1d, Unix98, Single Unix Specification). It is also internationalized and has one of the most complete internationalization interfaces known.

0 0