[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: removing coreutils' final strncpy uses

From: Eric Blake
Subject: Re: removing coreutils' final strncpy uses
Date: Tue, 17 Jul 2012 05:29:38 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1

On 07/17/2012 03:27 AM, Jim Meyering wrote:
> ohav chochmah wrote:
>> Why not reuse memccpy (in glibc)? as in 'memccpy(to, from, '\0', size)'.
>> Not only for sake of reusing, but memccpy is highly optimized for
>> ia64, and may be optimized for other arches in the future.

> but (for portability) that would require a gnulib module for memccpy.
> Such a module would be welcome regardless, but here it seems like
> it's not worth the complication, since the few uses of stzncpy are not
> performance sensitive.

An additional point: memccpy is POSIX, stzncpy is not.  We should
implement a memccpy module in gnulib anyways, but according to the
current glibc docs, it is already portable to pretty much everywhere but
BeOS (even mingw has it).

Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]