[uClibc] PATCH: use __libc_gettimeofday instead of gettimeofday

Erik Andersen andersen at codepoet.org
Tue Oct 19 19:50:54 UTC 2004


On Mon Oct 18, 2004 at 10:46:37AM +0200, Joakim Tjernlund wrote:
> > glibc uses __ prepended (w/o __libc_), wouldn't it be better to use the 
> > same conventions?
> > 
> > Peter
> 
> glibc uses both and I don't know why or when to use __ or __libc_ or both.

In practice, I've never felt a big need to use separate internal
vs external symbol names.  This has allowed uClibc to be a bit
smaller by avoiding all those extra relocations, symtable
entires, etc.

The naming convention is for the most part completely arbitrary.

Currently uClibc uses __libc_* as a symbol prefix on syscalls
when there is some compelling reason to not use the syscall name
directly.  i.e. __libc_fcntl might be mapped to either fcntl() or
fcntl64(), depending on whether __NR_fcntl64 is defined and LFS
is enabled.  In other cases, we have used the __libc_* prefix,
i.e.  to allow for pthreads to wrap syscalls and make them
cancelable (see uClibc/libpthread/linuxthreads/wrapsyscall.c).

The "__" prefix has generally been used for non-syscall internal
symbols that for some reason must be exposed.  i.e. functions
such as __read_etc_hosts_r(), and __uClibc_start_main() which are
called from more than one function and are therefore not static
internals, and internal data such as __time_tm, which is shared
by several functions.

 -Erik

--
Erik B. Andersen             http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--



More information about the uClibc mailing list