Go to the previous, next section.

chdir and fchdir

SYNOPSIS

int chdir(const char *path);

int fchdir(int fd);

PARAMETERS

path: [in] a pointer to the new current directory.

fd: [in] the file descriptor of the new directory.

DESCRIPTION

chdir changes the current directory to path and fchdir to fd.

RETURN VALUE

On success zero is returned. On error, -1 is returned and errno is set to one of the following values:

for chdir:

for fchdir:

Go to the previous, next section.