Casper writes: > You could implement it in terms of memchr, though no > optimized version of that exists either.
So at this point, there's no advantage in doing so. I chose to do it the way I did because (1) a memchr implementation would look too much like the GNU (GPL'd) implementation, (2) to preserve the visible derivation from strlen() as much as possible, and (3) to avoid an unnecessary added function call (and perhaps additional variable too). I suppose if memchr had an optimized version that violated causality (or at least thermodynamics), strnlen could always be redone to use it. :-) [...] [ regarding apptrace private implementation:] > >Ok, I'll ignore that for now. I was just looking at > precedents > >in terms of the behavior of private implementations. > > A "proper" project which makes a function public in > Solaris has > the onus on it to remove all private implementations > in the same > consolidation. Ok, but that's not the only function in /on/usr/src/lib/abi/apptrace/common/interceptlib.c that goes to extra effort to be safe in the face of a NULL arg (in contravention to normal practice where the caller is expected to know better). I don't know whether that's necessary for the particular use it might be put to, so that's why I hesitate to suggest that it should be changed to use a new public strnlen(). I suppose that means I've got to try and understand how apptrace works... > E.g., when I added "mkdtemp(3C)" in build 35 I also > updated > "mktemp(1)" as it carried a private implementation > and also made > sure that perl and ssh started using the Solaris > implementation and > no longer used their own implementation (for softare > which uses > configure this happens automatically but ON does not > use any > auto configuration, just make and config.h files > created earlier. Well, at least the rest of ON looks strnlen-free. :-) I suppose for the sfw folks, that's their problem? > The other thing is that you need to update > "mapfile-vers" so the > symbol is exported. > (usr/src/lib/libc/port/mapfile-vers) > > We bump the version once at the beginning of a > release (and > move around stuff added in backports), e.g.,: > > is_system_labeled; > ucred_getlabel; > _ucred_getlabel; > SUNW_1.22.2 bceause they're being backported for > Trusted Extensions. > > But mkdtemp is in SUNW_1.23 because it's only in S11. > Good to know; thanks. This message posted from opensolaris.org _______________________________________________ opensolaris-code mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/opensolaris-code
