1fattach(3C) Standard C Library Functions fattach(3C)
2
3
4
6 fattach - attach a STREAMS- or doors-based file descriptor to an object
7 in the file system name space
8
10 #include <stropts.h>
11
12 int fattach(int fildes, const char *path);
13
14
16 The fattach() function attaches a STREAMS- or doors-based file descrip‐
17 tor to an object in the file system name space, effectively associating
18 a name with fildes. The fildes argument must be a valid open file
19 descriptor representing a STREAMS or doors file. The path argument is a
20 path name of an existing object and the user must have appropriate
21 privileges or be the owner of the file and have write permissions. All
22 subsequent operations on path will operate on the STREAMS or doors file
23 until the STREAMS or doors file is detached from the node. The fildes
24 argument can be attached to more than one path, that is, a stream or
25 door can have several names associated with it.
26
27
28 The attributes of the named stream or door (see stat(2)), are initial‐
29 ized as follows: the permissions, user ID, group ID, and times are set
30 to those of path, the number of links is set to 1, and the size and
31 device identifier are set to those of the streams or doors device asso‐
32 ciated with fildes. If any attributes of the named stream or door are
33 subsequently changed (for example, chmod(2)), the attributes of the
34 underlying object are not affected.
35
37 Upon successful completion, fattach() returns 0. Otherwise it returns
38 −1 and sets errno to indicate an error.
39
41 The fattach() function will fail if:
42
43 EACCES The user is the owner of path but does not have write
44 permissions on path or fildes is locked.
45
46
47 EBADF The fildes argument is not a valid open file descrip‐
48 tor.
49
50
51 EBUSY The path argument is currently a mount point or has a
52 STREAMS or doors file descriptor attached to it.
53
54
55 EINVAL The path argument is a file in a remotely mounted
56 directory.
57
58
59 EINVAL The fildes argument does not represent a STREAMS or
60 doors file.
61
62
63 ELOOP Too many symbolic links were encountered in translating
64 path.
65
66
67 ENAMETOOLONG The size of path exceeds {PATH_MAX}, or the component
68 of a path name is longer than {NAME_MAX} while
69 {_POSIX_NO_TRUNC} is in effect.
70
71
72 ENOENT The path argument does not exist.
73
74
75 ENOTDIR A component of a path prefix is not a directory.
76
77
78 EPERM The effective user ID is not the owner of path or a
79 user with the appropriate privileges.
80
81
83 See attributes(5) for descriptions of the following attributes:
84
85
86
87
88 ┌─────────────────────────────┬─────────────────────────────┐
89 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
90 ├─────────────────────────────┼─────────────────────────────┤
91 │Interface Stability │Standard │
92 ├─────────────────────────────┼─────────────────────────────┤
93 │MT-Level │MT-Safe │
94 └─────────────────────────────┴─────────────────────────────┘
95
97 fdetach(1M), chmod(2), mount(2), stat(2), door_create(3C), fdetach(3C),
98 isastream(3C), attributes(5), standards(5), streamio(7I)
99
100
101 STREAMS Programming Guide
102
103
104
105SunOS 5.11 24 Jul 2002 fattach(3C)