[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

glibc vs BSD libc



Hello,
I am trying to study the various functionalities
supported by glibc Vs presence or absence of those
features in BSD libc.
This information here is w.r.t BSD libc which is
supplied with FreeBSD4.6(on intel)
i would like to know if i am missing something or some
information is not accurate.
Any comments??
thanx 
Atifa

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
1.
License
glibc :LGPL License
BSD libc:BSD

2.
glibc support for standards:
ANSI C(ISO C)
POSIX (Pthreads support)
SYSTEM V
(Eg:
Malloc tunable parameter(mallopt)
Extensions :
Statistics for storage allocation with malloc(mallinfo)
_tolower() and _toupper() supported.
)
Berkely UNIX
(Eg:
BSD Signal handling
BSD wait
Symbolic links
Sockets
)

BSD libc supports:
ANSI C
pthreads as per POSIX.1 std
Berkely UNIX

3.
Portability
glibc:Portable to more than one Kernel and hence large
BSD libc:Don?t attempt to be portable across kernels and hence smaller.

4.
Error Reporting facility(Eg:perror,strerror)
glibc:Supported
BSD libc:Supported

5.
Memory Allocation
Basic Dynamic memory allocation (malloc () and free())
Changing the size of previously allocated memory(realloc()
Allocating and Clearing the memory (calloc())
Allocating aligned memory blocks (memalign() and valloc())
Storage allocation hooks (_malloc_hook, _realloc_ hook)
Obstacks(stack like allocation,generally not so much used to malloc)
Alloca
Reallocating allocator(GNU Extensions (r_alloc,r_alloc_free))
Heap Consistency Checking(GNU Extensions(mcheck,mprobe))

glibc: Supports All of the above
BSD libc: Supports all except Storage allocation hooks ,obstacks,reallocating allocator,
	  heap consistancy checking & valloc() is now obsolete with current malloc 	  implementation which takes care for alignment on page size or larger allocations.



6.
Character Handling (tolower,toascii,etc)
glibc: Supported
BSD libc: Supported.

7.
a)String and array utilities
glibc: Supported
BSD libc:Supported except a few like strndup() and a few which are glibc specific like stpncpy,stpcpy are not Supported.

b)Collation functions
  (strcoll,strxfrm)
glibc: Supported
BSD libc: Supported.

c)Search Functions
  (memchr,strchr)
glibc: Supported
BSD libc: Supports except GNU extensions like memmem()


8.
a)Input/Output streams and Buffering:
glibc: Supported
BSD libc: Supported.

b)Line Oriented Input
glibc: Supported
BSD libc:Supported except GNU extensions like getline() and getdelim()

c)Formatted Output
(printf,sprintf,asprintf,etc)
glibc: Supported
BSD libc: Supported except obstack_printf() and obstack_vprintf()

d)Extend Syntax of printf template string (GNU extension)
glibc: Supported
BSD libc: Not Supported.

e)Other Streams(like string streams,Obstack streams,etc)
glibc: Supported
BSD libc: Not Supported.


9.
System call support
glibc: Supported
BSD libc: Supported.

10.
Support for Pipes and FIFOs.
glibc: Supported
BSD libc: Supported.

11.
File System Interfaces 
glibc: Supported
BSD libc: Supported Except GNU extensions like getumask()

12.
Sockets Support
glibc: Supported
BSD libc: Supported.

13.
Terminal Interfaces (isatty,ttyname,etc).
glibc: Supported
BSD libc: Supported.

14.
Math Library
Support for Mathematical computation and trignometric functions.
glibc: Supported
BSD libc: Supported.

15.
Searching and sorting(eg:bsearch,qsort)
glibc: Supported
BSD libc: Supported.

16.
Pattern matching(eg:fnmatch)
glibc: Supported
BSD libc: Supported.

17.
Shell Style word expansion
(Eg:wordexp,wordfree)
glibc: Supported
BSD libc: Not Supported.

18.
Date and Time
glibc: Supported
BSD libc: Supported.

19.
Extended Characters
glibc: Supported
BSD libc: No multi-byte character set functions.Breaks building UTF(Unicode) support in libncurses.

20.
Locale and Internationalization
glibc: Supported
BSD libc:libintl and libiconv provides i18n support.By default libc does not contain ?lintl.

21.
Signal handling
glibc: Supported
BSD libc: Supported.

22.
Process startup and termination
Program Arguments
(Eg:getopt)
Environment variables
Program Termination
glibc: All Supported
BSD libc:Supported.(getopt_long updated from NetBSD)


23.
System database and name service switch(NSS)
glibc: Supported
BSD libc: NSS not supported.Incompatible shadow and password support  and ancient utmp.
(Problem Solved by writing a library libshadow)


24.
User and Group Data base
glibc: Supported
BSD libc:Supported.Except a few functions like fgetpwent(),fgetpwent_r(),putpwent(),
Fgetgrent(),fgetgrent_r(). 


25.
System Information
glibc: Supported
BSD libc: utsname() not Supported.

26.
System Configuration parameters
glibc: Supported
BSD libc: Supported.

27.
Large file support
(fseeko64,ftello64)
glibc: Supported
BSD libc: Not Supported.

28.
Debugging features 
(mtrace(memory leaks),backtrace,etc)
glibc: Supported
BSD libc: Not Supported.

29.
glibc: Add-on packages Crypt
BSD libc:Contains additional libraries like Libcrypt

Reply to: