bug-gnulib
[Top][All Lists]
Advanced

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

Re: xreadlink


From: Jim Meyering
Subject: Re: xreadlink
Date: Sun, 25 Feb 2007 21:38:29 +0100

Bruno Haible <address@hidden> wrote:
> What can we do in gnulib?
>
> (a) Have 2 xreadlink like functions. Since the one without prior stat is more
>     natural, I would propose to rename the coreutils one, with the 'size'
>     argument, to 'xreadlink_after_stat'.
>
> Or
>
> (b) Merge the two functions into one. For example, when the function is called
>     with size = (size_t)(-1), let it mean "don't know" - and in this case,
>     let the function use a stack allocated buffer and memcpy().
>
> What do you think?

I like (a), but would prefer a different name, e.g.,
  xreadlink_with_hint
  xreadlink_with_size
  xreadlink_size_hint
  xreadlink_length_hint
because the hint needn't come from stat/st_size,

or even just
  xreadlink_hint
or, shortest of all ("2", for two parameters),
  xreadlink2

So far, I prefer xreadlink2.




reply via email to

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