[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1


fchdir Subroutine

Purpose

Directory pointed to by the file descriptor becomes the current working directory.

Library

Standard C Library (libc.a)

Syntax

#include <unistd.h>

int fchdir (int Fildes)

Description

The fchdir subroutine causes the directory specified by the Fildes parameter to become the current working directory.

Parameter


Fildes A file descriptor identifying an open directory obtained from a call to the open subroutine.

Return Values


0 Successful completion
-1 Not successful and errno set to one of the following.

Error Codes


EACCES Search access if denied.
EBADF The file referred to by Fildes is not an open file descriptor.
ENOTDIR The open file descriptor does not refer to a directory.

Related Information

The chdir (chdir Subroutine) subroutine, chroot (chroot Subroutine) subroutine, open (open, openx, open64, creat, or creat64 Subroutine) subroutine.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]