getcwd man page on DigitalUNIX

Man page or keyword search:  
man Server   12896 pages
apropos Keyword Search (all sections)
Output format
DigitalUNIX logo
[printable version]

getcwd(3)							     getcwd(3)

NAME
       getcwd - Get the pathname of the current directory

SYNOPSIS
       Standard C Library:

       #include <unistd.h>

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

       System V Library:

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

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

STANDARDS
       Interfaces  documented on this reference page conform to industry stan‐
       dards as follows:

       getcwd() - libc version: XSH5.0

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

PARAMETERS
       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
       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
       [Tru64 UNIX]  The getcwd()  function  is	 supported  for	 multithreaded
       applications.

RETURN VALUES
       Upon successful completion, getcwd() returns the buffer parameter. Oth‐
       erwise, a null value is returned and  errno  is	set  to	 indicate  the
       error.

ERRORS
       The  getcwd()  function sets errno to the specified values for the fol‐
       lowing 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 allo‐
	      cated.

SEE ALSO
       Functions: malloc(3), getwd(3)

       Standards: standards(5)

								     getcwd(3)
[top]

List of man pages available for DigitalUNIX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net