On 06/11/2012 07:19 AM, Rich Felker wrote:

> But if your goal is to read up until the next character in a
> particular set of special characters, why not fscanf(f, "%100[^xyz]",
> ...) with 100 replaced by your buffer size and xyz replaced by the
> specials? 

Because fscanf() is broken by design.  M4 refuses to use it, because
there is no portable way to use it on numeric parsing while still
detecting overflow, and because gnulib refuses to implement an fscanf()
replacement that works around the many different libc bugs in fscanf()
compliance because *scanf is so broken by design.

>> Depending on the function name you choose, we would have to add an m4
>> check to see if __freadahead() is defined; but once we know the name of
>> the function to check for at configure time, then it is quite simple to
>> code up gnulib's freadahead.c to call into the internal __freadahead()
>> function of libc, when one exists.
> 
> So right now, for DragonFly, it's just hard-coded? If you're willing
> to put in a test for it, I'm willing to add the function.

Yes, we are willing to do a configure-time link test for any internal
function name you are willing to give us.

-- 
Eric Blake   ebl...@redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to