/[gnats]/gnats/libiberty/getcwd.c
ViewVC logotype

Diff of /gnats/libiberty/getcwd.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by pdm, Mon Dec 10 23:03:26 2001 UTC revision 1.4 by chewie, Sat Nov 13 05:14:17 2004 UTC
# Line 2  Line 2 
2     This function is in the public domain. */     This function is in the public domain. */
3    
4  /*  /*
 NAME  
         getcwd -- get absolute pathname for current working directory  
5    
6  SYNOPSIS  @deftypefn Supplemental char* getcwd (char *@var{pathname}, int @var{len})
         char *getcwd (char pathname[len], len)  
7    
8  DESCRIPTION  Copy the absolute pathname for the current working directory into
9          Copy the absolute pathname for the current working directory into  @var{pathname}, which is assumed to point to a buffer of at least
10          the supplied buffer and return a pointer to the buffer.  If the  @var{len} bytes, and return a pointer to the buffer.  If the current
11          current directory's path doesn't fit in LEN characters, the result  directory's path doesn't fit in @var{len} characters, the result is
12          is NULL and errno is set.  @code{NULL} and @code{errno} is set.  If @var{pathname} is a null pointer,
13    @code{getcwd} will obtain @var{len} bytes of space using
14          If pathname is a null pointer, getcwd() will obtain size bytes of  @code{malloc}.
15          space using malloc.  
16    @end deftypefn
 BUGS  
         Emulated via the getwd() call, which is reasonable for most  
         systems that do not have getcwd().  
17    
18  */  */
19    
# Line 46  extern int errno; Line 40  extern int errno;
40  char *  char *
41  getcwd (buf, len)  getcwd (buf, len)
42    char *buf;    char *buf;
43    int len;    size_t len;
44  {  {
45    char ourbuf[MAXPATHLEN];    char ourbuf[MAXPATHLEN];
46    char *result;    char *result;

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26