Mail Archives: cygwin/2000/11/02/10:11:03
Earnie,
the problem is as follows:
- BSD only mentiones that a NULL buf results in a self allocated
buffer of reasonable size, regardless of the value of size.
- The man pages in different Linux systems (even Distros) differ.
Some man pages (I have those too on my systems) mentiones:
In this case, the allocated buffer has the
length size unless size IS ZERO, when buf is
allocated as big as necessary.
instead of
In this case, the allocated buffer has the
length size unless size IS LESS THAN ZERO, when
buf is allocated as big as necessary.
Some important tools rely on that behaviour like inetutils
which is original BSD code. It uses "path = getcwd(NULL, 0);"
legally from the BSD point of view. Perl bahaves the same.
Since SUSv2 states:
"If buf is a null pointer, the behaviour of getcwd() is undefined."
it's completely legal to behave reasonable in that case. For that
reason Chris has reverted the patch to the old behaviour.
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Developer mailto:cygwin AT sources DOT redhat DOT com
Red Hat, Inc.
mailto:vinschen AT redhat DOT com
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
- Raw text -