getcwd man page on Ultrix

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

getcwd(3)							     getcwd(3)

Name
       getcwd - get pathname of working directory

Syntax
       char I**getcwd (buf, size)
       char I**buf;
       int size;

Description
       The  subroutine	returns	 a  pointer to the current directory pathname.
       The value of size must be at least two greater than the length  of  the
       pathname to be returned.

       If buf is a NULL pointer, will obtain size bytes of space using In this
       case, the pointer returned by may be used as the argument in  a	subse‐
       quent call to free.

       The  function is implemented by using to pipe the output of the command
       into the specified string space.

Examples
       char ∗cwd, ∗getcwd();
       .
       .
       .
       if ((cwd = getcwd((char ∗)NULL, 64)) == NULL) {

	    perror("pwd");
	    exit(1);
       }
       printf("%s\n", cwd);

Return Values
       Returns NULL with errno set if size is not large enough, or if an error
       occurs in a lower-level function.

Diagnostics
       [EINVAL]	      The size argument is zero or negative.

       [ERANGE]	      The  size	 argument is greater than zero, but is smaller
		      than the length of the pathname+1;

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

       [ENOMEM]	      Insufficient storage space is available.

See Also
       pwd(1), malloc(3), popen(3)

								     getcwd(3)
[top]

List of man pages available for Ultrix

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