1FCHDIR(P)                  POSIX Programmer's Manual                 FCHDIR(P)
2
3
4

NAME

6       fchdir - change working directory
7

SYNOPSIS

9       #include <unistd.h>
10
11       int fchdir(int fildes);
12
13

DESCRIPTION

15       The  fchdir()  function  shall be equivalent to chdir() except that the
16       directory that is to be the new current working directory is  specified
17       by the file descriptor fildes.
18
19       A  conforming  application  can  obtain a file descriptor for a file of
20       type directory using open(), provided that the file  status  flags  and
21       access modes do not contain O_WRONLY or O_RDWR.
22

RETURN VALUE

24       Upon  successful  completion,  fchdir()  shall  return 0. Otherwise, it
25       shall return -1 and set errno to indicate the  error.  On  failure  the
26       current working directory shall remain unchanged.
27

ERRORS

29       The fchdir() function shall fail if:
30
31       EACCES Search  permission  is  denied  for  the directory referenced by
32              fildes.
33
34       EBADF  The fildes argument is not an open file descriptor.
35
36       ENOTDIR
37              The open file descriptor fildes does not refer to a directory.
38
39
40       The fchdir() may fail if:
41
42       EINTR  A signal was caught during the execution of fchdir().
43
44       EIO    An I/O error occurred while reading from or writing to the  file
45              system.
46
47
48       The following sections are informative.
49

EXAMPLES

51       None.
52

APPLICATION USAGE

54       None.
55

RATIONALE

57       None.
58

FUTURE DIRECTIONS

60       None.
61

SEE ALSO

63       chdir()   ,   the  Base  Definitions  volume  of  IEEE Std 1003.1-2001,
64       <unistd.h>
65
67       Portions of this text are reprinted and reproduced in  electronic  form
68       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
69       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
70       Specifications  Issue  6,  Copyright  (C) 2001-2003 by the Institute of
71       Electrical and Electronics Engineers, Inc and The Open  Group.  In  the
72       event of any discrepancy between this version and the original IEEE and
73       The Open Group Standard, the original IEEE and The Open Group  Standard
74       is  the  referee document. The original Standard can be obtained online
75       at http://www.opengroup.org/unix/online.html .
76
77
78
79IEEE/The Open Group                  2003                            FCHDIR(P)
Impressum