'\" te .\" Copyright 1989 AT&T. Copyright (c) 2002, Sun Microsystems, Inc. All Rights Reserved. .\" 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. .\" 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. .\" 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] .TH FATTACH 3C "Jul 24, 2002" .SH NAME fattach \- attach a STREAMS- or doors-based file descriptor to an object in the file system name space .SH SYNOPSIS .LP .nf #include \fBint\fR \fBfattach\fR(\fBint\fR \fIfildes\fR, \fBconst char *\fR\fIpath\fR); .fi .SH DESCRIPTION .sp .LP The \fBfattach()\fR function attaches a STREAMS- or doors-based file descriptor to an object in the file system name space, effectively associating a name with \fIfildes\fR. The \fIfildes\fR argument must be a valid open file descriptor representing a STREAMS or doors file. The \fIpath\fR argument is a path name of an existing object and the user must have appropriate privileges or be the owner of the file and have write permissions. All subsequent operations on \fIpath\fR will operate on the STREAMS or doors file until the STREAMS or doors file is detached from the node. The \fIfildes\fR argument can be attached to more than one \fIpath\fR, that is, a stream or door can have several names associated with it. .sp .LP The attributes of the named stream or door (see \fBstat\fR(2)), are initialized as follows: the permissions, user ID, group ID, and times are set to those of \fIpath\fR, the number of links is set to 1, and the size and device identifier are set to those of the streams or doors device associated with \fIfildes\fR. If any attributes of the named stream or door are subsequently changed (for example, \fBchmod\fR(2)), the attributes of the underlying object are not affected. .SH RETURN VALUES .sp .LP Upon successful completion, \fBfattach()\fR returns \fB0\fR. Otherwise it returns \fB\(mi1\fR and sets \fBerrno\fR to indicate an error. .SH ERRORS .sp .LP The \fBfattach()\fR function will fail if: .sp .ne 2 .na \fB\fBEACCES\fR\fR .ad .RS 16n The user is the owner of \fIpath\fR but does not have write permissions on \fIpath\fR or \fIfildes\fR is locked. .RE .sp .ne 2 .na \fB\fBEBADF\fR\fR .ad .RS 16n The \fIfildes\fR argument is not a valid open file descriptor. .RE .sp .ne 2 .na \fB\fBEBUSY\fR\fR .ad .RS 16n The \fIpath\fR argument is currently a mount point or has a STREAMS or doors file descriptor attached to it. .RE .sp .ne 2 .na \fB\fBEINVAL\fR\fR .ad .RS 16n The \fIpath\fR argument is a file in a remotely mounted directory. .RE .sp .ne 2 .na \fB\fBEINVAL\fR\fR .ad .RS 16n The \fIfildes\fR argument does not represent a STREAMS or doors file. .RE .sp .ne 2 .na \fB\fBELOOP\fR\fR .ad .RS 16n Too many symbolic links were encountered in translating \fIpath\fR. .RE .sp .ne 2 .na \fB\fBENAMETOOLONG\fR\fR .ad .RS 16n The size of \fIpath\fR exceeds {\fB\fR\fBPATH\fR\fB_MAX\fR}, or the component of a path name is longer than {\fBNAME_MAX\fR} while {\fB_POSIX_NO_TRUNC\fR} is in effect. .RE .sp .ne 2 .na \fB\fBENOENT\fR\fR .ad .RS 16n The \fIpath\fR argument does not exist. .RE .sp .ne 2 .na \fB\fBENOTDIR\fR\fR .ad .RS 16n A component of a path prefix is not a directory. .RE .sp .ne 2 .na \fB\fBEPERM\fR\fR .ad .RS 16n The effective user ID is not the owner of \fIpath\fR or a user with the appropriate privileges. .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(7) for descriptions of the following attributes: .sp .sp .TS box; c | c l | l . ATTRIBUTE TYPE ATTRIBUTE VALUE _ Interface Stability Standard _ MT-Level MT-Safe .TE .SH SEE ALSO .sp .LP .BR chmod (2), .BR mount (2), .BR stat (2), .BR door_create (3C), .BR fdetach (3C), .BR isastream (3C), .BR streamio (4I), .BR attributes (7), .BR standards (7), .BR fdetach (8) .sp .LP \fISTREAMS Programming Guide\fR