Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <3A0183AD.AE6257F6@redhat.com> Date: Thu, 02 Nov 2000 16:09:33 +0100 From: Corinna Vinschen Reply-To: cygwin AT sources DOT redhat DOT com X-Mailer: Mozilla 4.75 [en] (X11; U; Linux 2.2.14-SMP i686) X-Accept-Language: de, en MIME-Version: 1.0 To: cygwin Subject: Re: latest cygwin does not track pwd? References: <20001102144930 DOT 23956 DOT qmail AT web109 DOT yahoomail DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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