*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> getcwd (3)              



NAME    [Toc]    [Back]

       getcwd - Get the pathname of the current directory

SYNOPSIS    [Toc]    [Back]

       Standard C Library:

       #include <unistd.h>

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

       System V Library:

       char *getcwd(
               char *buffer,
               int size );

LIBRARY    [Toc]    [Back]

       Standard C Library (libc) System V Library (libsysv)

STANDARDS    [Toc]    [Back]

       Interfaces  documented  on  this reference page conform to
       industry standards as follows:

       getcwd() - libc version: XSH5.0

       Refer to the standards(5) reference page for more information
 about industry standards and associated tags.

PARAMETERS    [Toc]    [Back]

       Points  to a string space to hold the pathname.  Specifies
       the length of the string space in bytes. The value of  the
       size parameter must be at least the length of the pathname
       to be returned plus one byte for the terminating null.

DESCRIPTION    [Toc]    [Back]

       The getcwd() function returns a pointer to a  string  containing
  the  absolute  pathname of the current directory.
       The getwd() function is called to obtain the pathname.

       [Tru64 UNIX]  If the buffer parameter is a  null  pointer,
       the   getcwd()  function,  using  the  malloc()  function,
       obtains the number of bytes of free space as specified  by
       the  size parameter. In this case, the pointer returned by
       the getcwd() function can be used as the  parameter  in  a
       subsequent call to the free() function.

NOTES    [Toc]    [Back]

       [Tru64  UNIX]  The getcwd() function is supported for multithreaded

RETURN VALUES    [Toc]    [Back]

       Upon successful completion, getcwd()  returns  the  buffer
       parameter.  Otherwise,  a null value is returned and errno
       is set to indicate the error.

ERRORS    [Toc]    [Back]

       The getcwd() function sets errno to the  specified  values
       for  the  following  conditions: Read or search permission
       was denied for a component  of  the  pathname.   The  size
       parameter is zero.

              [Tru64  UNIX]  The  size  parameter is less than or
              equal to zero (for the libsys5 version of  getcwd()
              only).   The  size  parameter is greater than zero,
              but is smaller than the length of the pathname + 1.
              The  requested  amount of memory could not be allocated.

SEE ALSO    [Toc]    [Back]

       Functions: malloc(3), getwd(3)

       Standards: standards(5)

[ Back ]
 Similar pages
Name OS Title
getwd Tru64 Get current directory pathname
getwd IRIX get current working directory pathname
getcwd IRIX get pathname of current working directory
Cwd IRIX get pathname of current working directory
pwd Tru64 Displays the pathname of the current working directory
pxfgetcwd IRIX Gets the pathname of the working directory
getcwd OpenBSD get working directory pathname
getwd OpenBSD get working directory pathname
getcwd NetBSD get working directory pathname
getcwd FreeBSD get working directory pathname
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service