RTEMS Logo

RTEMS 4.9.2 On-Line Library


Files and Directories Manager getcwd - Gets current working directory

PREV UP NEXT Bookshelf RTEMS POSIX API User's Guide

4.4.9: getcwd - Gets current working directory

CALLING SEQUENCE:

#include <unistd.h>

int getcwd( void );

STATUS CODES:

EINVAL
Invalid argument
ERANGE
Result is too large
EACCES
Search permission is denied for a directory in a file's path prefix.

DESCRIPTION:

The getcwd() function copies the absolute pathname of the current working directory to the character array pointed to by buf. The size argument is the number of bytes available in buf

NOTES:

There is no way to determine the maximum string length that fetcwd() may need to return. Applications should tolerate getting ERANGE and allocate a larger buffer.

It is possible for getcwd() to return EACCES if, say, login puts the process into a directory without read access.

The 1988 standard uses int instead of size_t for the second parameter.


PREV UP NEXT Bookshelf RTEMS POSIX API User's Guide

Copyright © 1988-2008 OAR Corporation