bug-gnulib
[Top][All Lists]
Advanced

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

Re: module suggestion: realpath


From: Ben Pfaff
Subject: Re: module suggestion: realpath
Date: Mon, 29 Oct 2007 13:34:20 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Sam Steingold <address@hidden> writes:

> Bruno Haible wrote:
>>     Linux manpage:
>> 
>>     BUGS
>>        Avoid using this function. It is broken by design since it
>>        is  impossible to determine a suitable size for the output
>>        buffer, resolved_path.  According to  POSIX  a  buffer  of
>>        size PATH_MAX suffices, but PATH_MAX need not be a defined
>>        constant, and may have to be  obtained  using  pathconf().
>
> this is equally applicable to any function what relies on
> PATH_MAX,e.g., getcwd.

Indeed, gnulib includes a module that replaces getcwd, if
necessary, with a version that allocates a buffer as large as
needed if the buffer argument is a null pointer.

> pretty soon every user of gnulib will be distributing a full glibc with
> his package.

There does seem to be some risk of this happening :-)
-- 
Ben Pfaff 
http://benpfaff.org





reply via email to

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