"glibc and libc"
glibc and libc are all C function libraries under Linux.
libc is the ANSI C function library under Linux, and GLIBC is the GUN C function library under Linux.
What is the difference between ANSI C and GNU c?
The ANSI C function library is the basic C language function library, which contains the most basic library functions of C language. This library can be divided into 15 sections based on the header file, which includes:
- <ctype.h>: A function prototype containing a function for testing a feature character, and a function prototype for converting uppercase and lowercase letters;
- <errno.h>: Defines the macro used to report error conditions;
- <float.h>: Contains the floating-point size limit of the system;
- <math.h>: A function prototype containing mathematical library functions;
- <stddef.h>: Contains the common function definitions used to perform some calculation C;
- <stdio.h>: Function prototypes containing standard input and output library functions, and the information they use;
- <stdlib.h>: A function prototype that includes the conversion of numbers to text, and the conversion of text to numbers, as well as memory allocations, random numbers, and functional prototypes of other utility functions;
- <string.h>: A function prototype containing string processing functions;
- <time.h>: Function prototypes and types that contain time and date operations;
- <stdarg.h>: Contains function prototypes and macros, which are used to process the parameter lists of functions with unknown values and types;
- <signal.h>: Contains function prototypes and macros to handle various conditions that may occur during program execution;
- <setjmp.h>: Contains a prototype of a function that bypasses a general function call and returns a sequence, that is, a non-local jump;
- <locale.h>: Contains function prototypes and other information that enables programs to be modified for the region in which they are running.
- Regional representations can enable computer systems to process different data expression conventions, such as the world's date, time, dollar number, and large numbers;
- <assert.h>: Contains macros and information for diagnostic purposes, to help debug the program.
The above library functions are available in various Ides that support the C language.
the GNU C function library is something similar to a third-party plugin. Because Linux is written in C, some Linux operations are implemented in C, so the GUN organization has developed a C language library so that we can better use the C language to develop Linux operating system-based programs. However, the different Linux distributions now have different ways of handling the two libraries, some of which may already be integrated in the same library.
to view the glibc version of the current system:
1.
?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
[Root @Betty ~]#/lib/libc.so.6 GNU C Library Stable release version 2.5, by Roland McGrath et al. Copyright (C) 2006 Fre E Software Foundation, Inc. This isfreesoftware; See thesourceforcopying conditions. There is NO warranty; Not evenformerchantability or FITNESS for A particular PURPOSE. Compiled by GNU CC version 4.1.2 20080704 (Red Hat 4.1.2-52). Compiled on a Linux 2.6.9 system on 2013-01-08. Available extensions: the C stubs add-on version 2.1.2. cryptadd-on version 2.1 by Michael Glad and others & Nbsp; gnu libidn by Simon Josefsson gnu Libio by Per Bothner nis (YP)/nis+ NSS modules 0.19 by Thorsten Kukuk & Nbsp; native POSIX Threads Library by Ulrich Drepper et al & Nbsp; &nbsP bind-8.2.3-t5b rt using Linux kernel AIO thread-localstorage support Included. For bugs reporting instructions, please see: |
2.
?
1 2 3 4 5 6 7 |
[Root @Betty ~]# ldd--version ldd (GNU libc) 2.5 Copyright (C) 2006 free Software Foundation, Inc. This isfreesoftware; See thesourceforcopying conditions. There is NO warranty; Not evenformerchantability or FITNESS for A particular PURPOSE. Written by Roland McGrath and Ulrich drepper. [Root @Betty ~]# |
"glibc and GLib"
wrong view: GLib in front of a "G", so that glib is the GNU East, and that GLIBC is a subset of glib.
In fact, glib and glibc basically do not have much connection, perhaps the only common point is that it is the C programming need to call the library just.
GLib is the foundation of the GTK + library and Gnome. GLib can be used on multiple platforms, such as Linux, Unix, Windows, and more. GLib provides a corresponding substitute for many standard, commonly used C language structures.
"Official notes"
Glib
GLib is a general-purpose utility library, which provides many useful data types, macros, type conversions, string UTI Lities, 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, all
functions be invisibly threadsafe with the exception of data structure Manipul ation functions, where, if you have both threads manipulating the same data structure, they must use a lock to synchronize Their operation.
GLib is the low-level core library, which forms the basis for projects such as GTK + and GNOME. IT provides data structure handling for C, portability wrappers, and interfaces to such runtime functionality as an event loop, threads, dynamic loading, and an object system.
GLIBC
Overview:
Any unix-like operating system needs a C Library:the library which defines the "system calls" and other basic Facilitie s such as Open, malloc, printf, exit ...
The GNU C library is used as the C library under the GNU systems and most systems with the Linux kernel.
Project Goals:
The GNU C Library is primarily designed to being a portable and high performance C library. It follows all relevant standards including ISO C11 and posix.1-2008. It is also internationalized
and have 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 does not conflict with The standards. Different compatibility modes (selectable when you compile a application) allow the peaceful coexistence of compatibility Support for different varieties of Unix.
"Other claims"
libc is actually a generic. Any content that meets the requirements of the C standard is a libc.
GLIBC is an implementation of the GNU Organization for LIBC. It is one of the foundations of Unix/linux.
Microsoft also has its own libc implementation, called MSVCRT.
embedded industry also commonly used UCLIBC, is a mini version of the libc.
"Finishing" the relationship between libc, glibc and glib