| 1 | /* Emulate getcwd using getwd.
|
|---|
| 2 | This function is in the public domain. */
|
|---|
| 3 |
|
|---|
| 4 | /*
|
|---|
| 5 |
|
|---|
| 6 | @deftypefn Supplemental char* getcwd (char *@var{pathname}, int @var{len})
|
|---|
| 7 |
|
|---|
| 8 | Copy the absolute pathname for the current working directory into
|
|---|
| 9 | @var{pathname}, which is assumed to point to a buffer of at least
|
|---|
| 10 | @var{len} bytes, and return a pointer to the buffer. If the current
|
|---|
| 11 | directory's path doesn't fit in @var{len} characters, the result is
|
|---|
| 12 | @code{NULL} and @code{errno} is set. If @var{pathname} is a null pointer,
|
|---|
| 13 | @code{getcwd} will obtain @var{len} bytes of space using
|
|---|
| 14 | @code{malloc}.
|
|---|
|
|---|