The implementation of __xpg_strerror_r spends time doing an strlen call,
and then potentially returning before the value is actually used.
This can be optimized.
Created attachment 6502 [details]
Fold the copyright years together e.g. 1991-2012.
If you haven't posted this to libc-alpha, please do and I'll ack.
This looks like a straight forward and useful optimization.
I cleaned up the patch and send it to libc-alpha myself.
Targeting for 2.18 now.
Committed for glibc 2.18:
Author: 2012-12-27 Bruno Haible <firstname.lastname@example.org>
Date: Thu Dec 27 22:37:39 2012 +0100
BZ#14317: Optimze __xpg_strerror_r
* string/xpg-strerror.c (__xpg_strerror_r): Optimize, call
strlen only if needed.
thanks for the patch!