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

fdetach.3p (4608B)


  1. '\" et
  2. .TH FDETACH "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. fdetach
  12. \(em detach a name from a STREAMS-based file descriptor (\fBSTREAMS\fP)
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <stropts.h>
  17. .P
  18. int fdetach(const char *\fIpath\fP);
  19. .fi
  20. .SH DESCRIPTION
  21. The
  22. \fIfdetach\fR()
  23. function shall detach a STREAMS-based file from the file to which
  24. it was attached by a previous call to
  25. \fIfattach\fR().
  26. The
  27. .IR path
  28. argument points to the pathname of the attached STREAMS file. The
  29. process shall have appropriate privileges or be the owner of the file.
  30. A successful call to
  31. \fIfdetach\fR()
  32. shall cause all pathnames that named the attached STREAMS file to again
  33. name the file to which the STREAMS file was attached. All subsequent
  34. operations on
  35. .IR path
  36. shall operate on the underlying file and not on the STREAMS file.
  37. .P
  38. All open file descriptions established while the STREAMS file was
  39. attached to the file referenced by
  40. .IR path
  41. shall still refer to the STREAMS file after the
  42. \fIfdetach\fR()
  43. has taken effect.
  44. .P
  45. If there are no open file descriptors or other references to the
  46. STREAMS file, then a successful call to
  47. \fIfdetach\fR()
  48. shall be equivalent to performing the last
  49. \fIclose\fR()
  50. on the attached file.
  51. .SH "RETURN VALUE"
  52. Upon successful completion,
  53. \fIfdetach\fR()
  54. shall return 0; otherwise, it shall return \-1 and set
  55. .IR errno
  56. to indicate the error.
  57. .SH ERRORS
  58. The
  59. \fIfdetach\fR()
  60. function shall fail if:
  61. .TP
  62. .BR EACCES
  63. Search permission is denied on a component of the path prefix.
  64. .TP
  65. .BR EINVAL
  66. The
  67. .IR path
  68. argument names a file that is not currently attached.
  69. .TP
  70. .BR ELOOP
  71. A loop exists in symbolic links encountered during resolution of the
  72. .IR path
  73. argument.
  74. .TP
  75. .BR ENAMETOOLONG
  76. .br
  77. The length of a component of a pathname is longer than
  78. {NAME_MAX}.
  79. .TP
  80. .BR ENOENT
  81. A component of
  82. .IR path
  83. does not name an existing file or
  84. .IR path
  85. is an empty string.
  86. .TP
  87. .BR ENOTDIR
  88. A component of the path prefix names an existing file that is neither
  89. a directory nor a symbolic link to a directory, or the
  90. .IR path
  91. argument contains at least one non-\c
  92. <slash>
  93. character and ends with one or more trailing
  94. <slash>
  95. characters and the last pathname component names an existing file
  96. that is neither a directory nor a symbolic link to a directory.
  97. .TP
  98. .BR EPERM
  99. The effective user ID is not the owner of
  100. .IR path
  101. and the process does not have appropriate privileges.
  102. .P
  103. The
  104. \fIfdetach\fR()
  105. function may fail if:
  106. .TP
  107. .BR ELOOP
  108. More than
  109. {SYMLOOP_MAX}
  110. symbolic links were encountered during resolution of the
  111. .IR path
  112. argument.
  113. .TP
  114. .BR ENAMETOOLONG
  115. .br
  116. The length of a pathname exceeds
  117. {PATH_MAX},
  118. or pathname resolution of a symbolic link produced an intermediate
  119. result with a length that exceeds
  120. {PATH_MAX}.
  121. .LP
  122. .IR "The following sections are informative."
  123. .SH EXAMPLES
  124. .SS "Detaching a File"
  125. .P
  126. The following example detaches the STREAMS-based file
  127. .BR /tmp/named-STREAM
  128. from the file to which it was attached by a previous, successful call
  129. to
  130. \fIfattach\fR().
  131. Subsequent calls to open this file refer to the underlying file, not to
  132. the STREAMS file.
  133. .sp
  134. .RS 4
  135. .nf
  136. #include <stropts.h>
  137. \&...
  138. char *pathname = "/tmp/named-STREAM";
  139. int ret;
  140. .P
  141. ret = fdetach(pathname);
  142. .fi
  143. .P
  144. .RE
  145. .SH "APPLICATION USAGE"
  146. None.
  147. .SH RATIONALE
  148. None.
  149. .SH "FUTURE DIRECTIONS"
  150. The
  151. \fIfdetach\fR()
  152. function may be removed in a future version.
  153. .SH "SEE ALSO"
  154. .IR "\fIfattach\fR\^(\|)"
  155. .P
  156. The Base Definitions volume of POSIX.1\(hy2017,
  157. .IR "\fB<stropts.h>\fP"
  158. .\"
  159. .SH COPYRIGHT
  160. Portions of this text are reprinted and reproduced in electronic form
  161. from IEEE Std 1003.1-2017, Standard for Information Technology
  162. -- Portable Operating System Interface (POSIX), The Open Group Base
  163. Specifications Issue 7, 2018 Edition,
  164. Copyright (C) 2018 by the Institute of
  165. Electrical and Electronics Engineers, Inc and The Open Group.
  166. In the event of any discrepancy between this version and the original IEEE and
  167. The Open Group Standard, the original IEEE and The Open Group Standard
  168. is the referee document. The original Standard can be obtained online at
  169. http://www.opengroup.org/unix/online.html .
  170. .PP
  171. Any typographical or formatting errors that appear
  172. in this page are most likely
  173. to have been introduced during the conversion of the source files to
  174. man page format. To report such errors, see
  175. https://www.kernel.org/doc/man-pages/reporting_bugs.html .