This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: __gettimeofday visibility and sem_timedwait
Hi Maciek,
Maciek Borzecki wrote:
> Eventually,
> the problem was traced back to one of our internal libraries which
> went through some cleanups recently. As it turned out, the library
> defined __gettimeofday symbol and a missing static was not spotted
> during review.
The '__' prefix is not supposed to be used in application code. Libc
headers can even #define identifiers starting with it to something
crazy and break your build.
See POSIX, XSH 2.2.2 "The Name Space"[1]:
| The following identifiers are reserved regardless of the inclusion
| of headers:
|
| 1. With the exception of identifiers beginning with the prefix
| _POSIX_, all identifiers that begin with an <underscore> and either
| an uppercase letter or another <underscore> are always reserved for
| any use by the implementation.
Hope that helps,
Jonathan
[1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_02_02