1getwd(3C)                Standard C Library Functions                getwd(3C)
2
3
4

NAME

6       getwd - get current working directory pathname
7

SYNOPSIS

9       #include <unistd.h>
10
11       char *getwd(char *path_name);
12
13

DESCRIPTION

15       The  getwd()  function  determines  an absolute pathname of the current
16       working directory of the calling process, and copies that pathname into
17       the array pointed to by the path_name argument.
18
19
20       If  the  length  of  the  pathname  of the current working directory is
21       greater than (PATH_MAX + 1) including the null byte, getwd() fails  and
22       returns a null pointer.
23

RETURN VALUES

25       Upon  successful  completion,  a  pointer  to the string containing the
26       absolute pathname of the current working directory is returned.  Other‐
27       wise,  getwd()  returns  a  null  pointer and the contents of the array
28       pointed to by path_name are undefined.
29

ERRORS

31       No errors are defined.
32

USAGE

34       For portability to implementations conforming to versions of the X/Open
35       Portability Guide prior to SUS, getcwd(3C) is preferred over this func‐
36       tion.
37

ATTRIBUTES

39       See attributes(5) for descriptions of the following attributes:
40
41
42
43
44       ┌─────────────────────────────┬─────────────────────────────┐
45ATTRIBUTE TYPE               ATTRIBUTE VALUE              
46       ├─────────────────────────────┼─────────────────────────────┤
47       │Interface Stability          │Standard                     │
48       └─────────────────────────────┴─────────────────────────────┘
49

SEE ALSO

51       getcwd(3C), attributes(5), standards(5)
52
53
54
55SunOS 5.11                        24 Jul 2002                        getwd(3C)
Impressum