2004-04-10 18:53:55 +00:00
|
|
|
.TH GETWD 3
|
|
|
|
.SH NAME
|
|
|
|
getwd \- get current directory
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.B #include <u.h>
|
|
|
|
.br
|
|
|
|
.B #include <libc.h>
|
|
|
|
.PP
|
|
|
|
.B
|
|
|
|
char* getwd(char *buf, int size)
|
|
|
|
.SH DESCRIPTION
|
|
|
|
.I Getwd
|
|
|
|
fills
|
|
|
|
.I buf
|
|
|
|
with a null-terminated string representing the current directory
|
|
|
|
and returns
|
|
|
|
.IR buf .
|
|
|
|
.PP
|
|
|
|
.I Getwd
|
|
|
|
places no more than
|
|
|
|
.I size
|
|
|
|
bytes in the buffer provided.
|
|
|
|
.SH SOURCE
|
2004-04-19 19:22:56 +00:00
|
|
|
.B /usr/local/plan9/src/libc/9sys/getwd.c
|
2004-04-10 18:53:55 +00:00
|
|
|
.SH "SEE ALSO"
|
|
|
|
.IR pwd (1),
|
2004-04-11 03:42:27 +00:00
|
|
|
.IR fd2path (3)
|
2004-04-10 18:53:55 +00:00
|
|
|
.SH DIAGNOSTICS
|
|
|
|
On error, zero is returned.
|
2004-04-11 03:42:27 +00:00
|
|
|
.IR Errstr (3)
|
2004-04-10 18:53:55 +00:00
|
|
|
may be consulted for more information.
|
|
|
|
.SH BUGS
|
|
|
|
Although the name returned by
|
|
|
|
.I getwd
|
|
|
|
is guaranteed to be the path used to reach the directory,
|
|
|
|
if the name space has changed underfoot, the name may be
|
|
|
|
incorrect.
|