1 uClibc and Glibc are not the same -- there are a number of differences which
2 may or may not cause you problems. This document attempts to list these
3 differences and, when completed, will contain a full list of all relevant
7 1) uClibc is smaller than glibc. We attempt to maintain a glibc compatible
8 interface, allowing applications that compile with glibc to easily compile with
9 uClibc. However, we do not include _everything_ that glibc includes, and
10 therefore some applications may not compile. If this happens to you, please
11 report the failure to the uclibc mailing list, with detailed error messages.
13 2) uClibc is much more configurable then glibc. This means that a developer
14 may have compiled uClibc in such a way that significant amounts of
15 functionality have been omitted.
17 3) uClibc does not even attempt to ensure binary compatibility across releases.
18 When a new version of uClibc is released, you may or may not need to recompile
21 4) malloc(0) in glibc returns a valid pointer to something(!?!?) while in
22 uClibc calling malloc(0) returns a NULL. The behavior of malloc(0) is listed
23 as implementation-defined by SuSv3, so both libraries are equally correct.
24 This difference also applies to realloc(NULL, 0). I personally feel glibc's
25 behavior is not particularly safe.
27 5) uClibc does not provide a database library (libdb).
29 6) uClibc does not support NSS (/lib/libnss_*), which allows glibc to easily
30 support various methods of authentication and DNS resolution. uClibc only
31 supports flat password files and shadow password files for storing
32 authentication information.
34 7) uClibc's libresolv is only a stub. Some, but not all of the functionality
35 provided by glibc's libresolv is provided internal to uClibc. Other functions
36 are not at all implemented.
38 8) libnsl provides support for Network Information Service (NIS) which was
39 originally called "Yellow Pages" or "YP", which is an extension of RPC invented
40 by Sun to share Unix password files over the network. I personally think NIS
41 is an evil abomination, and should be avoided. These days, using ldap is much
42 more effective mechanism for doing the same thing. uClibc provides a stub
43 libnsl, but and has no actuall support for Network Information Service (NIS).
44 We therefore, also do not provide any of the headers files provided by glibc
45 under /usr/include/rpcsvc. I am open to implementing ldap based password
46 authentication, but I do not personally intend to implement it (since I have no
49 9) uClibc's locale support is not 100% complete yet. We are working on it.
51 10) uClibc's math library only supports long double as inlines, and even
52 then the long double support is quite limited.
54 11) uClibc's libcrypt does not support the reentrant crypt_r, setkey_r and
55 encrypt_r, since these are not required by SuSv3.
57 12) uClibc does not implement wordexp()
60 13) uClibc directly uses the kernel types to define most opaque data types.
62 14) uClibc directly uses the linux kernel's arch specific 'stuct stat'.
64 15) Add other things here as they come up......
68 ****************************** Manuel's Notes ******************************
70 Some general comments...
72 The intended target for all my uClibc code is ANSI/ISO C99 and SUSv3
73 compliance. While some glibc extensions are present, many will eventually
74 be configurable. Also, even when present, the glibc-like extensions may
75 differ slightly or be more restrictive than the native glibc counterparts.
76 They are primarily meant to be porting _aides_ and not necessarily
79 Now for some details...
83 1) Leap seconds are not supported.
84 2) /etc/timezone and the whole zoneinfo directory tree are not supported.
85 To set the timezone, set the TZ environment variable as specified in
86 http://www.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap08.html
87 or you may also create an /etc/TZ file of a single line, ending with a
88 newline, containing the TZ setting. For example
89 echo CST6CDT > /etc/TZ
90 3) Currently, locale specific eras and alternate digits are not supported.
91 They are on my TODO list.
92 4) The extension fields tm_gmtoff and tm_zone, even prefixed with "__", are
93 not currently supported as they aren't required by SUSv3 and I didn't
94 need them when I wrote the time code.
98 1) The only multibyte encoding to be supported will be UTF-8. The various
99 ISO-8859-* encodings will be (optionally) supported. The internal
100 representation of wchar's is assumed to be 31 bit unicode values in
101 native endian representation. Also, the underlying char encoding is
102 assumed to match ASCII in the range 0-0x7f.
106 1) The target for support is SUSv3 locale functionality. While nl_langinfo
107 has been extended, similar to glibc, it only returns values for related
109 2) Currently, collation support is being implemented.
113 1) For printf, %a, %A, and floating point locale-specific grouping are not
114 yet implemented. Also, conversion of large magnitude floating-point values
115 suffers a loss of precision due to the algorithm used. The conversion
116 function was written before uClibc had proper semi-numerical macros/functions.
117 This code is slated to be rewritten after the i10n/i18n work is completed.
118 2) uClibc's printf is much stricter than glibcs, especially regarding positional
119 args. The entire format string is parsed first and an error is returned if
120 a problem is detected. Also, currently at most 10 positional args are allowed
121 although this is configurable.
122 3) BUFSIZ is currently 256. No attempt is made at automatic tuning of internal
123 buffer sizes for stdio streams. In fact, the stdio code in general sacrifices
124 sophistication/performace for minimal size.
125 4) uClibc allows glibc-like custom printf functions. However, while not
126 currently checked, the specifier must be <= 0x7f.
127 5) uClibc allows glibc-like custom streams. However, no in-buffer seeking is
129 6) uClibc's scanf still needs work.
130 7) The functions fcloseall() and __fpending() can behave differently than their
132 8) uClibc's setvbuf is more restrictive about when it can be called than glibc's
133 is. The standards specify that setvbuf must occur before any other operations
134 take place on the stream.
135 9) Right now, %m is not handled properly by printf when the format uses positional
139 More to follow as I think of it...