8999 SMBIOS: cleanup 32-bit specific code
[unleashed.git] / usr / src / man / man3c / fattach.3c
blob263ef2358f387491b4186dcce314f277edcf3863
1 '\" te
2 .\" Copyright 1989 AT&T.  Copyright (c) 2002, Sun Microsystems, Inc.  All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH FATTACH 3C "Jul 24, 2002"
7 .SH NAME
8 fattach \- attach a STREAMS- or doors-based file descriptor to an object in the
9 file system name space
10 .SH SYNOPSIS
11 .LP
12 .nf
13 #include <stropts.h>
15 \fBint\fR \fBfattach\fR(\fBint\fR \fIfildes\fR, \fBconst char *\fR\fIpath\fR);
16 .fi
18 .SH DESCRIPTION
19 .sp
20 .LP
21 The \fBfattach()\fR function attaches a STREAMS- or doors-based file descriptor
22 to an object in the file system name space, effectively associating a name with
23 \fIfildes\fR. The \fIfildes\fR argument must be a valid open file descriptor
24 representing a STREAMS or doors file. The \fIpath\fR argument is a path name of
25 an existing object and the user must have appropriate privileges or be the
26 owner of the file and have write permissions. All subsequent operations on
27 \fIpath\fR will operate on the STREAMS or doors file until the STREAMS or doors
28 file is detached from the node. The \fIfildes\fR argument can be attached to
29 more than one \fIpath\fR, that is, a stream or door can have several names
30 associated with it.
31 .sp
32 .LP
33 The attributes of the named stream or door (see \fBstat\fR(2)), are initialized
34 as follows: the permissions, user ID, group ID, and times are set to those of
35 \fIpath\fR, the number of links is set to 1, and the size and device identifier
36 are set to those of the streams or doors device associated with \fIfildes\fR.
37 If any attributes of the named stream or door are subsequently changed  (for
38 example, \fBchmod\fR(2)), the attributes of the underlying object are not
39 affected.
40 .SH RETURN VALUES
41 .sp
42 .LP
43 Upon successful completion, \fBfattach()\fR returns \fB0\fR.  Otherwise it
44 returns \fB\(mi1\fR and sets  \fBerrno\fR to indicate an error.
45 .SH ERRORS
46 .sp
47 .LP
48 The \fBfattach()\fR function will fail if:
49 .sp
50 .ne 2
51 .na
52 \fB\fBEACCES\fR\fR
53 .ad
54 .RS 16n
55 The user is the owner of \fIpath\fR but does not have write permissions on
56 \fIpath\fR or \fIfildes\fR is locked.
57 .RE
59 .sp
60 .ne 2
61 .na
62 \fB\fBEBADF\fR\fR
63 .ad
64 .RS 16n
65 The \fIfildes\fR argument is not a valid open file descriptor.
66 .RE
68 .sp
69 .ne 2
70 .na
71 \fB\fBEBUSY\fR\fR
72 .ad
73 .RS 16n
74 The \fIpath\fR argument is currently a mount point or has a STREAMS or doors
75 file descriptor attached to it.
76 .RE
78 .sp
79 .ne 2
80 .na
81 \fB\fBEINVAL\fR\fR
82 .ad
83 .RS 16n
84 The \fIpath\fR argument is a file in a remotely mounted directory.
85 .RE
87 .sp
88 .ne 2
89 .na
90 \fB\fBEINVAL\fR\fR
91 .ad
92 .RS 16n
93 The \fIfildes\fR argument does not represent a STREAMS or doors file.
94 .RE
96 .sp
97 .ne 2
98 .na
99 \fB\fBELOOP\fR\fR
101 .RS 16n
102 Too many symbolic links were encountered in translating \fIpath\fR.
106 .ne 2
108 \fB\fBENAMETOOLONG\fR\fR
110 .RS 16n
111 The size of \fIpath\fR exceeds {\fB\fR\fBPATH\fR\fB_MAX\fR}, or the component
112 of a path name is longer than {\fBNAME_MAX\fR} while {\fB_POSIX_NO_TRUNC\fR} is
113 in effect.
117 .ne 2
119 \fB\fBENOENT\fR\fR
121 .RS 16n
122 The \fIpath\fR argument does not exist.
126 .ne 2
128 \fB\fBENOTDIR\fR\fR
130 .RS 16n
131 A component of a path prefix is not a directory.
135 .ne 2
137 \fB\fBEPERM\fR\fR
139 .RS 16n
140 The effective user ID is not the owner of \fIpath\fR or a user with the
141 appropriate privileges.
144 .SH ATTRIBUTES
147 See \fBattributes\fR(5) for descriptions of the following attributes:
152 box;
153 c | c
154 l | l .
155 ATTRIBUTE TYPE  ATTRIBUTE VALUE
157 Interface Stability     Standard
159 MT-Level        MT-Safe
162 .SH SEE ALSO
165 \fBfdetach\fR(1M), \fBchmod\fR(2), \fBmount\fR(2), \fBstat\fR(2),
166 \fBdoor_create\fR(3C), \fBfdetach\fR(3C), \fBisastream\fR(3C),
167 \fBattributes\fR(5), \fBstandards\fR(5), \fBstreamio\fR(7I)
170 \fISTREAMS Programming Guide\fR