logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

fchdir.3p (2730B)


  1. '\" et
  2. .TH FCHDIR "3P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. fchdir
  12. \(em change working directory
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <unistd.h>
  17. .P
  18. int fchdir(int \fIfildes\fP);
  19. .fi
  20. .SH DESCRIPTION
  21. The
  22. \fIfchdir\fR()
  23. function shall be equivalent to
  24. \fIchdir\fR()
  25. except that the directory that is to be the new current working
  26. directory is specified by the file descriptor
  27. .IR fildes .
  28. .P
  29. A conforming application can obtain a file descriptor for a file of
  30. type directory using
  31. \fIopen\fR(),
  32. provided that the file status flags and access modes do not contain
  33. O_WRONLY or O_RDWR.
  34. .SH "RETURN VALUE"
  35. Upon successful completion,
  36. \fIfchdir\fR()
  37. shall return 0. Otherwise, it shall return \-1 and set
  38. .IR errno
  39. to indicate the error. On failure the current working directory
  40. shall remain unchanged.
  41. .SH ERRORS
  42. The
  43. \fIfchdir\fR()
  44. function shall fail if:
  45. .TP
  46. .BR EACCES
  47. Search permission is denied for the directory referenced by
  48. .IR fildes .
  49. .TP
  50. .BR EBADF
  51. The
  52. .IR fildes
  53. argument is not an open file descriptor.
  54. .TP
  55. .BR ENOTDIR
  56. The open file descriptor
  57. .IR fildes
  58. does not refer to a directory.
  59. .P
  60. The
  61. \fIfchdir\fR()
  62. may fail if:
  63. .TP
  64. .BR EINTR
  65. A signal was caught during the execution of
  66. \fIfchdir\fR().
  67. .TP
  68. .BR EIO
  69. An I/O error occurred while reading from or writing to the file system.
  70. .LP
  71. .IR "The following sections are informative."
  72. .SH EXAMPLES
  73. None.
  74. .SH "APPLICATION USAGE"
  75. None.
  76. .SH RATIONALE
  77. None.
  78. .SH "FUTURE DIRECTIONS"
  79. None.
  80. .SH "SEE ALSO"
  81. .IR "\fIchdir\fR\^(\|)",
  82. .IR "\fIdirfd\fR\^(\|)"
  83. .P
  84. The Base Definitions volume of POSIX.1\(hy2017,
  85. .IR "\fB<unistd.h>\fP"
  86. .\"
  87. .SH COPYRIGHT
  88. Portions of this text are reprinted and reproduced in electronic form
  89. from IEEE Std 1003.1-2017, Standard for Information Technology
  90. -- Portable Operating System Interface (POSIX), The Open Group Base
  91. Specifications Issue 7, 2018 Edition,
  92. Copyright (C) 2018 by the Institute of
  93. Electrical and Electronics Engineers, Inc and The Open Group.
  94. In the event of any discrepancy between this version and the original IEEE and
  95. The Open Group Standard, the original IEEE and The Open Group Standard
  96. is the referee document. The original Standard can be obtained online at
  97. http://www.opengroup.org/unix/online.html .
  98. .PP
  99. Any typographical or formatting errors that appear
  100. in this page are most likely
  101. to have been introduced during the conversion of the source files to
  102. man page format. To report such errors, see
  103. https://www.kernel.org/doc/man-pages/reporting_bugs.html .