delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/11/02/09:32:26

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <20001102143057.21392.qmail@web116.yahoomail.com>
Date: Thu, 2 Nov 2000 06:30:57 -0800 (PST)
From: Earnie Boyd <earnie_boyd AT yahoo DOT com>
Subject: RE: latest cygwin does not track pwd?
To: "Robinow, David" <drobinow AT dayton DOT adroit DOT com>,
"'cygwin AT sources DOT redhat DOT com'" <cygwin AT sources DOT redhat DOT com>
MIME-Version: 1.0

--- "Robinow, David" <drobinow AT dayton DOT adroit DOT com> 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 

NAME

     getcwd - get the pathname of the current working directory 

 SYNOPSIS



     #include <unistd.h>

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


 DESCRIPTION

     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
     undefined. 

 RETURN VALUE

     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. 

 ERRORS

     The getcwd() function will fail if: 

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

     The getcwd() function may fail if: 

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

     [ENOMEM]
          Insufficient storage space is available. 

 EXAMPLES

     None. 

 APPLICATION USAGE

     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. 

 FUTURE DIRECTIONS

     None. 

 SEE ALSO

     malloc(), <unistd.h>. 

DERIVATION

     Derived from Issue 1 of the SVID. 


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

=====
Earnie Boyd
mailto:earnie_boyd AT yahoo DOT com

---         <http://earniesystems.safeshopper.com>         ---
--- Cygwin: POSIX on Windows <http://gw32.freeyellow.com/> ---
---   Minimalist GNU for Windows <http://www.mingw.org/>   ---

__________________________________________________
Do You Yahoo!?
From homework help to love advice, Yahoo! Experts has your answer.
http://experts.yahoo.com/

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019