This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: latest cygwin does not track pwd?

--- "Robinow, David" <> wrote:
> > It's definitely 'getcwd(NULL, 0)' in Chuck's sources.
>   Also in 5.7.0 development sources. 
> > I think I'll just revert the behavior.  It appears that a number of
> > packages are expecting it.
>   Is there a reason these packages can't be fixed?
>   Is 'getcwd(NULL, -1)' broken in some version?
                    The Single UNIX  Specification, Version 2
                          Copyright  1997 The Open Group 


     getcwd - get the pathname of the current working directory 


     #include <unistd.h>

     char *getcwd(char *buf, size_t size);


     The getcwd() function places an absolute pathname of the current working
directory in the array pointed to by buf, and returns buf. The
     size argument is the size in bytes of the character array pointed to by
the buf argument. If buf is a null pointer, the behaviour of getcwd() is


     Upon successful completion, getcwd() returns the buf argument. Otherwise,
getcwd() returns a null pointer and sets errno to indicate the
     error. The contents of the array pointed to by buf is then undefined. 


     The getcwd() function will fail if: 

          The size argument is 0. 
          The size argument is greater than 0, but is smaller than the length
of the pathname +1. 

     The getcwd() function may fail if: 

          Read or search permission was denied for a component of the pathname.

          Insufficient storage space is available. 




     If buf is a null pointer, getcwd() may obtain size bytes of memory using
malloc(). In this case, the pointer returned by getcwd() may be
     used as the argument in a subsequent call to free(). Invoking getcwd()
with buf as a null pointer is not recommended. 




     malloc(), <unistd.h>. 


     Derived from Issue 1 of the SVID. 

                                        UNIX  is a registered Trademark of The
Open Group.
                                              Copyright  1997 The Open Group 

Earnie Boyd

---         <>         ---
--- Cygwin: POSIX on Windows <> ---
---   Minimalist GNU for Windows <>   ---

Do You Yahoo!?
From homework help to love advice, Yahoo! Experts has your answer.

Want to unsubscribe from this list?
Send a message to

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]