Blob


1 .TH GETWD 3
2 .SH NAME
3 getwd \- get current directory
4 .SH SYNOPSIS
5 .B #include <u.h>
6 .br
7 .B #include <libc.h>
8 .PP
9 .B
10 char* getwd(char *buf, int size)
11 .SH DESCRIPTION
12 .I Getwd
13 fills
14 .I buf
15 with a null-terminated string representing the current directory
16 and returns
17 .IR buf .
18 .PP
19 .I Getwd
20 places no more than
21 .I size
22 bytes in the buffer provided.
23 .SH SOURCE
24 .B \*9/src/lib9/getwd.c
25 .SH "SEE ALSO"
26 .MR pwd (1)
27 .SH DIAGNOSTICS
28 On error, zero is returned.
29 .MR Errstr (3)
30 may be consulted for more information.
31 .SH BUGS
32 To avoid name conflicts with the underlying system,
33 .I getwd
34 is a preprocessor macro defined as
35 .IR p9getwd ;
36 see
37 .MR intro (3) .