getcwd man page on YellowDog

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

GETCWD(2)		   Linux Programmer's Manual		     GETCWD(2)

NAME
       getcwd - get current working directory

SYNOPSIS
       /*
	* This page documents the getcwd(2) system call, which
	* is not defined in any user-space header files; you should
	* use getcwd(3) defined in <unistd.h> instead in applications.
	*/

       long getcwd(char *buf, unsigned long size);

DESCRIPTION
       The  getcwd() function copies an absolute pathname of the current work‐
       ing directory to the array pointed to by buf, which is of length size.

       If the current absolute path name would require a  buffer  longer  than
       size  elements, -1 is returned, and errno is set to ERANGE; an applica‐
       tion should check for this error, and allocate a larger buffer if  nec‐
       essary.

       If buf is NULL, the behaviour of getcwd() is undefined.

RETURN VALUE
       -1  on failure (for example, if the current directory is not readable),
       with errno set accordingly, and the number of characters stored in  buf
       on success. The contents of the array pointed to by buf is undefined on
       error.

       Note that this return value differs from the  getcwd(3)	library	 func‐
       tion, which returns NULL on failure and the address of buf on success.

ERRORS
       ENOMEM if user memory cannot be mapped

       ENOENT if directory does not exist (i.e. it has been deleted)

       ERANGE if not enough space available for storing the path

       EFAULT if memory access violation occurs while copying

CONFORMING TO
       The  getcwd  system  call  is  Linux specific, use the getcwd C library
       function for portability.

SEE ALSO
       getcwd(3)

Linux 2.4			  2003-03-28			     GETCWD(2)
[top]

List of man pages available for YellowDog

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