getcwd man page on Xenix

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



     GETCWD(S)		      XENIX System V		     GETCWD(S)

     Name
	  getcwd - Get the pathname of current working directory.

     Syntax
	  char *getcwd (pnbuf, maxlen)
	  char *pnbuf;
	  int maxlen;

     Description
	  getcwd returns a pointer to the current directory pathname.
	  If pnbuf is a NULL pointer, getcwd will obtain maxlen bytes
	  of space using malloc(S).  In this case, the pointer
	  returned by getcwd may be used as the argument in a
	  subsequent call to free(S).  If pnbuf is not a NULL pointer,
	  then the pathname is placed in the space pointed to by pnbuf
	  and pnbuf is returned.

	  In all cases, the value of maxlen must be at least two
	  greater than the length of the pathname to be returned.

	  getcwd is implemented by using popen(S) to pipe the output
	  of the pwd(C) command into the specified string space.

     Example
	  char *cwd, *getcwd();
	  .
	  .
	  .
	  if ((cwd = getcwd((char *)NULL, 64)) == NULL) {
	       perror(``pwd'');
	       exit(1);
	  }
	  printf(``%s\n'', cwd);

     See Also
	  pwd(C), malloc(S), popen(S)

     Page 1					      (printed 8/7/87)

     GETCWD(S)		      XENIX System V		     GETCWD(S)

     Errors
	       [EINVAL] size is zero

	       [ENOMEM] no space is available

	       [ERANGE] size not large enough to hold the path name.

     Diagnostics
	  Returns NULL with errno set if maxlen is not large enough.

     Notes
	  maxlen must be 2 more than the true length of the pathname.

     Page 2					      (printed 8/7/87)

[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server Xenix

List of man pages available for Xenix

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