Difference between uclibc and glibc

Source: Internet
Author: User

Uclibc and glibc are different. There are many differences between them, and the following differences may bring you some problems.
1. uclibc is smaller than glibc. Although uclibc and glibc are compatible with existing interfaces, it is more convenient to use uclibc to compile applications than to use glibc to compile applications, however, uclibc does not include all interfaces in glibc, so some applications may not be compiled in uclibc.
2. uclibc is more configurable than glibc.
3. uclibc does not guarantee that the released library binary is compatible with the old version of uclibc. When a new version of the uclibc library is released, you may or may not need to re-compile the application.
4. If you call malloc (0) in glibc, a valid pointer is returned. However, if you call malloc (0) in uclibc, a null pointer is returned. According to the definition of malloc (0) behavior in susv3, the implementation of both libraries is correct. For the call of relloc (null, 0), the implementation of the two libraries is also different. I personally feel that this implementation of glibc is not particularly secure.
The implementation of malloc in glibc can be adjusted using the malloc_check _ environment variable. This method is mainly used for malloc debugging. These extended malloc debugging features are unavailable in uclibc. In Linux, there are many libraries with some malloc debugging functions (such as dmalloc, electric fence, and valgrind), which are better than the extended malloc debugging functions in glibc. Therefore, removing these features in uclibc does not cause any loss.
5. uclibc does not provide a library (libdb) for data interfaces ).
6. uclibc does not support NSS (/lib/libnss _ *). glibc supports authentication and DNS resolution in different ways. Uclibc only supports the use of flat password files or shadow password files to store authorization information. If you need more complex authorization, You can compile and install Pam.
7. The libresolv library in uclibc is just a pile. Not all functions in the libresolv library of glibc are provided by uclibc, and many functions are not implemented.
8. Provide Network Information Service Support (NIS) libnsl library (originally known as Yellow Pages YP). Sun extended to RPC and used to share Unix Password files on the network
. I personally think that NIs is an annoying thing and should be used. Therefore, using LDAP is more effective than using NIs when the same functions are implemented. Although uclibc provides libnsl, it does not support NIS. Therefore, header files in/usr/include/rpcsvc are not provided in glibc.
9. The region support of uclibc is not 100% complete. Working in this area

10. The data function library of uclibc only supports long double, and its support for long double is also very limited. Only a small number of mathematical functions are implemented. If the application uses the double type, the program runs well.
11. The libcrpt library of uclibc does not support re-entry of crypt_r, setkey_r and encrypt_r, because these are not defined by susv3.
12. uclibc uses the kernel data type to define most transparent data types.
13. uclibc supports using the structure "struct stat" unique to the Linux kernel structure ".
14. The uclibc Runtime Library librt currently lacks the AIO interface, all clock interfaces, and shared memory interfaces (only the timer interface and Message Queue interface are implemented)

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.