Bruno Haible <[EMAIL PROTECTED]> 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