[Xcb] [Bug 4232] xlsclients much too slow over network

Peter Harris pharris at opentext.com
Tue Sep 8 10:48:13 PDT 2009


Josh Triplett wrote:
> On Thu, Sep 03, 2009 at 01:15:29PM -0700, Ian Osgood wrote:
>> On Sep 2, 2009, at 8:49 AM, Peter Harris wrote:
>>
>>>  - Re-implement strnlen for people who have only ISO C.
>>>
>>> Peter Harris
>> How about using memchr?  (I don't know what kind of #ifdefs to wrap  
>> this in, though.)
>>
>> size_t strnlen(const char *s, size_t len)
>> {
>> 	const char *end = (const char *)memchr(s, 0, len);
>> 	return end ? end-s : len;
>> }
> 
> That looks good.  As for the ifdefs, you'd probably need to add an
> autoconf test for the strnlen function and then use "ifndef
> HAVE_STRNLEN" or similar.  Alternatively, just call it "xstrnlen" and
> use it all the time.

If I understand autoconf correctly (I probably don't), it can generate a
strnlen function if a functional one isn't included with the OS.

Please take a look at git://anongit.freedesktop.org/~peterh/xlsclients
and let me know if that looks sensible.

Thanks,
 Peter Harris
-- 
               Open Text Connectivity Solutions Group
Peter Harris                    http://www.opentext.com/connectivity
Research and Development        Phone: +1 905 762 6001
pharris at opentext.com            Toll Free: 1 877 359 4866


More information about the Xcb mailing list