1fdetach(3C) Standard C Library Functions fdetach(3C)
2
3
4
6 fdetach - detach a name from a STREAMS-based file descriptor
7
9 #include <stropts.h>
10
11 int fdetach(const char *path);
12
13
15 The fdetach() function detaches a STREAMS-based file from the file to
16 which it was attached by a previous call to fattach(3C). The path argu‐
17 ment points to the pathname of the attached STREAMS file. The process
18 must have appropriate privileges or be the owner of the file. A suc‐
19 cessful call to fdetach() causes all pathnames that named the attached
20 STREAMS file to again name the file to which the STREAMS file was
21 attached. All subsequent operations on path will operate on the under‐
22 lying file and not on the STREAMS file.
23
24
25 All open file descriptions established while the STREAMS file was
26 attached to the file referenced by path, will still refer to the
27 STREAMS file after the fdetach() has taken effect.
28
29
30 If there are no open file descriptors or other references to the
31 STREAMS file, then a successful call to fdetach() has the same effect
32 as performing the last close(2) on the attached file.
33
35 Upon successful completion, fdetach() returns 0. Otherwise, it returns
36 −1 and sets errno to indicate the error.
37
39 The fdetach() function will fail if:
40
41 EACCES Search permission is denied on a component of the path
42 prefix.
43
44
45 EPERM The effective user ID is not the owner of path and the
46 process does not have appropriate privileges.
47
48
49 ENOTDIR A component of the path prefix is not a directory.
50
51
52 ENOENT A component of path does not name an existing file or
53 path is an empty string.
54
55
56 EINVAL The path argument names a file that is not currently
57 attached.
58
59
60 ENAMETOOLONG The size of a pathname exceeds PATH_MAX, or a pathname
61 component is longer than NAME_MAX while _POSIX_NO_TRUNC
62 is in effect.
63
64
65 ELOOP Too many symbolic links were encountered in resolving
66 path.
67
68
69
70 The fdetach() function may fail if:
71
72 ENAMETOOLONG Pathname resolution of a symbolic link produced an
73 intermediate result whose length exceeds PATH_MAX.
74
75
77 See attributes(5) for descriptions of the following attributes:
78
79
80
81
82 ┌─────────────────────────────┬─────────────────────────────┐
83 │ATTRIBUTE TYPE │ATTRIBUTE VALUE │
84 ├─────────────────────────────┼─────────────────────────────┤
85 │Interface Stability │Standard │
86 └─────────────────────────────┴─────────────────────────────┘
87
89 fdetach(1M), close(2), fattach(3C), attributes(5), standards(5),
90 streamio(7I)
91
92
93 STREAMS Programming Guide
94
95
96
97SunOS 5.11 24 Jul 2002 fdetach(3C)