[PATCH] locale: Make _nl_C_locobj_ptr usable outside of libc

Florian Weimer fweimer@redhat.com
Fri Sep 16 11:53:00 GMT 2016


I need something like this to fix incorrect locale dependence in 
libresolv (bug 19687).

I tested this with the fixes, including one for nscd, which uses
__libc_C_locobj@GLIBC_PRIVATE.  libresolv uses _nl_C_locobj@GLIBC_PRIVATE.

I'm not entirely sure if we should use the function approach everywhere 
instead.  But as far as I can tell, this patch does not lead to the 
allocation of space for a _nl_C_locobj copy in libresolv (which we would 
not want because it is wasteful).

An alternative would add of functions such as those in <ctype.h> and 
strcasecmp/strncasecmp which are always tied to the C locale.  This 
would be more efficient because access to the locale object is easier, 
or the variants can even be optimized inline (such as isblank).

Thanks,
Florian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: locale.patch
Type: text/x-patch
Size: 4441 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20160916/cca0b941/attachment.bin>


More information about the Libc-alpha mailing list