chdir(2)
NAME
chdir − change default directory
SYNTAX
int chdir(dirname)
char *dirname;
DESCRIPTION
The chdir system call causes dirname to become the current working directory, that is, the starting point for path names not beginning with “/”. The named dirname is the null-byte terminated address of the pathname of a directory.
RETURN VALUE
If unsuccessful, returns a −1, and the global variable errno indicates the error code.
DIAGNOSTICS
The chdir call will fail if:
[EACCES] Search permission is denied for a component of the path name.
[EFAULT] The named dirname points outside the process’s allocated address space.
[ENFILE] There is insufficient system space to contain the inode.
[ENOENT] Either the named directory or an element within the named path does not exist.
[ENOTDIR] A component of the path name is not a directory.
ASSEMBLER
(chdir = 12.)
sys chdir; dirname