Sam Steingold <[EMAIL PROTECTED]> 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