70 lines
1.1 KiB
HTML
70 lines
1.1 KiB
HTML
<HTML>
|
|
<HEAD>
|
|
<TITLE>getcwd(3)</TITLE>
|
|
</HEAD>
|
|
<BODY>
|
|
<H1>getcwd(3)</H1>
|
|
<HR>
|
|
<PRE>
|
|
|
|
</PRE>
|
|
<H2>NAME</H2><PRE>
|
|
getcwd - get current working directory pathname
|
|
|
|
|
|
</PRE>
|
|
<H2>SYNOPSIS</H2><PRE>
|
|
<STRONG>#include</STRONG> <STRONG><unistd.h></STRONG>
|
|
|
|
<STRONG>char</STRONG> <STRONG>*getcwd(char</STRONG> <STRONG>*</STRONG><EM>pathname</EM><STRONG>,</STRONG> <STRONG>size_t</STRONG> <EM>len</EM><STRONG>)</STRONG>
|
|
|
|
|
|
</PRE>
|
|
<H2>DESCRIPTION</H2><PRE>
|
|
<STRONG>Getcwd</STRONG> copies the absolute pathname of the current working directory to
|
|
<EM>pathname</EM> and returns a pointer to the result. <EM>Pathname</EM> is a character
|
|
array of length <EM>len</EM>.
|
|
|
|
|
|
</PRE>
|
|
<H2>DIAGNOSTICS</H2><PRE>
|
|
<STRONG>Getcwd</STRONG> returns a null pointer and sets <STRONG>errno</STRONG> if an error occurs. The
|
|
error will reflect the system call errors that may occur if the path to
|
|
the current directory is searched upwards to the root directory. The
|
|
error <STRONG>ERANGE</STRONG> is returned if the result does not fit within <EM>len</EM> bytes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</PRE>
|
|
</BODY>
|
|
</HTML>
|