latest cygwin does not track pwd?

Corinna Vinschen vinschen@redhat.com
Thu Nov 2 07:09:00 GMT 2000


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@sources.redhat.com
Red Hat, Inc.
mailto:vinschen@redhat.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com



More information about the Cygwin mailing list