1FATTACH(3P) POSIX Programmer's Manual FATTACH(3P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
12 fattach - attach a STREAMS-based file descriptor to a file in the file
13 system name space (STREAMS)
14
16 #include <stropts.h>
17
18 int fattach(int fildes, const char *path);
19
20
22 The fattach() function shall attach a STREAMS-based file descriptor to
23 a file, effectively associating a pathname with fildes. The application
24 shall ensure that the fildes argument is a valid open file descriptor
25 associated with a STREAMS file. The path argument points to a pathname
26 of an existing file. The application shall have the appropriate privi‐
27 leges or be the owner of the file named by path and have write permis‐
28 sion. A successful call to fattach() shall cause all pathnames that
29 name the file named by path to name the STREAMS file associated with
30 fildes, until the STREAMS file is detached from the file. A STREAMS
31 file can be attached to more than one file and can have several path‐
32 names associated with it.
33
34 The attributes of the named STREAMS file shall be initialized as fol‐
35 lows: the permissions, user ID, group ID, and times are set to those of
36 the file named by path, the number of links is set to 1, and the size
37 and device identifier are set to those of the STREAMS file associated
38 with fildes. If any attributes of the named STREAMS file are subse‐
39 quently changed (for example, by chmod()), neither the attributes of
40 the underlying file nor the attributes of the STREAMS file to which
41 fildes refers shall be affected.
42
43 File descriptors referring to the underlying file, opened prior to an
44 fattach() call, shall continue to refer to the underlying file.
45
47 Upon successful completion, fattach() shall return 0. Otherwise, -1
48 shall be returned and errno set to indicate the error.
49
51 The fattach() function shall fail if:
52
53 EACCES Search permission is denied for a component of the path prefix,
54 or the process is the owner of path but does not have write per‐
55 missions on the file named by path.
56
57 EBADF The fildes argument is not a valid open file descriptor.
58
59 EBUSY The file named by path is currently a mount point or has a
60 STREAMS file attached to it.
61
62 ELOOP A loop exists in symbolic links encountered during resolution of
63 the path argument.
64
65 ENAMETOOLONG
66 The size of path exceeds {PATH_MAX} or a component of path is
67 longer than {NAME_MAX}.
68
69 ENOENT A component of path does not name an existing file or path is an
70 empty string.
71
72 ENOTDIR
73 A component of the path prefix is not a directory.
74
75 EPE