Sun Microsystems, Inc.
spacerspacer
spacer   www.sun.com docs.sun.com | | |  
spacer
black dot
   
A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z
    
 
Standard C Library Functionsgetwd(3C)


NAME

 getwd - get current working directory pathname

SYNOPSIS

 
#include <unistd.h>
char *getwd(char *path_name);

DESCRIPTION

 

The getwd() function determines an absolute pathname of the current working directory of the calling process, and copies that pathname into the array pointed to by the path_name argument.

If the length of the pathname of the current working directory is greater than (PATH_MAX + 1) including the null byte, getwd() fails and returns a null pointer.

RETURN VALUES

 

Upon successful completion, a pointer to the string containing the absolute pathname of the current working directory is returned. Otherwise, getwd() returns a null pointer and the contents of the array pointed to by path_name are undefined.

ERRORS

 

No errors are defined.

USAGE

 

For portability to implementations conforming to versions of the X/Open Portability Guide prior to SUS, getcwd(3C) is preferred over this function.

SEE ALSO

 

getcwd(3C), standards(5)


SunOS 5.9Go To TopLast Changed 26 Feb 1997

 
      
      
Copyright 2002 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.