LIBC and Glibc__linux in Linux

Source: Internet
Author: User
Tags assert function definition function prototype mathematical functions time and date

First, LIBC Library

The C standard library provided by the Linux platform includes:

A set of header files that define many types and macros and declare many library functions. The directories under which these headers are placed depend on different compilers, Stdarg.h and Stddef.h are located in the/usr/lib/gcc/i486-linux-gnu/4.3.2/include directory, stdio.h, Stdlib.h, Time.h, MATH.H and Assert.h are located in the/usr/include directory. C99 standard definition of the header file has 24, this book only describes one of the most basic, most commonly used a few.

A set of library files that provide the implementation of a library function. Most library functions are in the LIBC shared library, and some library functions are in another shared library, such as mathematical functions in LIBM. In the 4th section, "Shared library," The LIBC shared library is usually/lib/libc.so.6.

ANSI C function Library is the basic C language function library, contains the C language most basic library function. This library can be divided into 15 sections based on header files, including:
<ctype.h&gt: A function prototype containing a function to test a characteristic character, and a function prototype for converting uppercase and lowercase letters; &LT;ERRNO.H&GT: defines a macro to report error conditions; <float.h> : Contains the system's floating-point size limit; <math.h&gt: A function prototype containing a mathematical library function; <stddef.h&gt: a common function definition for performing some computed C; <stdio.h> : function prototypes that contain standard input and output library functions, and the information they use; <stdlib.h&gt: A function prototype that contains numeric conversions to text and text to numbers, as well as memory allocations, random numbers, and functional prototypes of other utility functions; <string.h : function prototype containing string processing functions; <time.h&gt: function prototypes and types containing time and date operations; &LT;STDARG.H&GT: A parameter list of functions that contain function prototypes and macros for handling unknown values and types; < Signal.h&gt: Contains function prototypes and macros to handle various conditions that may occur during program execution; <setjmp.h&gt: A prototype that contains a function that bypasses a general function call and returns a sequence, that is, a nonlocal jump; <locale.h> : Contains the function prototypes and other information that allows the program to modify the area in which it is running. Regional representations can enable computer systems to process different data expression conventions, such as the world's date, time, dollars and large numbers; <assert.h&gt: Contains macros and information for diagnostics and help with program debugging. The above library functions are available in all of its support for the C language IDE. If you use fopen/memcpy and so on, the standard C functions, of course, use the standard C library (ANSI c) when linking, and if you use a function that read/write these glibc libraries, you must use the GLIBC library when linking.

The GNU C function library is something similar to a Third-party plug-in. Since Linux is written in C, some Linux operations are implemented in C, so the GUN organization has developed a library of C to allow us to better use the C language to develop Linux OS based programs. However, different Linux distributions now have different approaches to these two libraries, some of which may already be integrated into the same library.

glibc Download Address: http://mirror.hust.edu.cn/gnu/

GLIBC is the implementation of the C standard library below Linux, namely the GNU C library. GLIBC itself is the GNU's C standard library, and then gradually became the standard C library of Linux, and Linux, the original standard C library Linux libc is gradually no longer maintained. The standard C library below Linux not only has this one, such as UCLIBC (https://www.uclibc.org/), KLIBC, and the Linux libc mentioned above, but glibc is undoubtedly the most used. GLIBC the. So file in the/lib directory is libc.so.6.


Two ways to view the glibc version of the current system:
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; The source for copying conditions.
05 There is NO warranty; Not even to 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.