1 GETWD(3C) Standard C Library Functions GETWD(3C)
2
3
4
5 NAME
6 getwd - get current working directory pathname
7
8 SYNOPSIS
9 #include <unistd.h>
10
11 char *getwd(char *path_name);
12
13
14 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
24 RETURN VALUES
25 Upon successful completion, a pointer to the string containing the
26 absolute pathname of the current working directory is returned.
27 Otherwise, getwd() returns a null pointer and the contents of the array
28 pointed to by path_name are undefined.
29
30 ERRORS
31 No errors are defined.
32
33 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
36 function.
37
38 ATTRIBUTES
39 See attributes(5) for descriptions of the following attributes:
40
41
42
43
44 +--------------------+-----------------+
45 | ATTRIBUTE TYPE | ATTRIBUTE VALUE |
46 +--------------------+-----------------+
47 |Interface Stability | Standard |
48 +--------------------+-----------------+
49
50 SEE ALSO
51 getcwd(3C), attributes(5), standards(5)
52
53
54
55 July 24, 2002 GETWD(3C)
|
1 GETWD(3C) Standard C Library Functions GETWD(3C)
2
3 NAME
4 getwd get current working directory pathname
5
6 SYNOPSIS
7 #include <unistd.h>
8
9 char *
10 getwd(char *path_name);
11
12 DESCRIPTION
13 The getwd() function determines an absolute pathname of the current
14 working directory of the calling process, and copies that pathname into
15 the array pointed to by the path_name argument.
16
17 If the length of the pathname of the current working directory is greater
18 than (PATH_MAX + 1) including the null byte, getwd() fails and returns a
19 null pointer.
20
21 RETURN VALUES
22 Upon successful completion, a pointer to the string containing the
23 absolute pathname of the current working directory is returned.
24 Otherwise, getwd() returns a null pointer and the contents of the array
25 pointed to by path_name are undefined.
26
27 ERRORS
28 No errors are defined.
29
30 USAGE
31 The getwd() function is supplied for backwards compatibility. The
32 getcwd(3C) should be used instead.
33
34 INTERFACE STABILITY
35 Obsolete Standard.
36
37 SEE ALSO
38 getcwd(3C), standards(5)
39
40 STANDARDS
41 The getwd() function is available in the following compilation
42 environments. See standards(5).
43
44 X/Open Portability Guide Issue4, Version2 (XPG4.2)
45 Version2 of the Single UNIX Specification (SUSv2)
46 Version3 of the Single UNIX Specification (SUSv3)
47
48 It was marked obsolete in Version3 of the Single UNIX Specification
49 (SUSv3) and removed from IEEE Std 1003.1-2008 (POSIX.1).
50
51 illumos March 30, 2015 illumos
|