This is the mail archive of the
cygwin-developers
mailing list for the Cygwin project.
Re: src/winsup/utils ChangeLog setfacl.c
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin-developers at cygwin dot com
- Date: Mon, 13 Dec 2010 17:42:51 +0100
- Subject: Re: src/winsup/utils ChangeLog setfacl.c
- References: <20101211204701.18879.qmail@sourceware.org> <4D064562.8090206@redhat.com>
- Reply-to: cygwin-developers at cygwin dot com
On Dec 13 09:10, Eric Blake wrote:
> On 12/11/2010 01:47 PM, XXXXXXXXXXXXXXXXXX wrote:
Bzz.
> > CVSROOT: /cvs/src
> > Module name: src
> > Changes by: XXXXXXXXXXXXXXXXXXXXXX 2010-12-11 20:47:01
Bzz again.
> >
> > Modified files:
> > winsup/utils : ChangeLog setfacl.c
> >
> > Log message:
> > * setfacl.c (strchrnul): New function.
>
> Should we implement strchrnul in newlib instead? Your implementation
> works, but the naive byte-wise loop is almost an order of magnitude
> slower than searching a word at a time using some of the same tricks as
> strlen(). And several GNU programs, such as tar, would use native
> strchrnul() if it existed (right now, they get it from gnulib).
In case of setfacl the strings are so short that it doesn't matter.
As for newlib, there's not only a file libc/string/strchr.c, but also
assembler implementations for various targets in libc/machine. In
theory it would be nice to implement strchrnul in C and for all targets
instead, and then implement strchr like this:
strchr (a, b) {
ret = strchrnul (a, b)
return *ret || !b ? ret : NULL;
}
But maybe a generic, independent C implementation copied from
libc/string/strchr.c would be sufficent for a start...
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat