'\" 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 "24 Jul 2002" "SunOS 5.11" "Standard C Library Functions" .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 .mk .na \fB\fBEACCES\fR\fR .ad .RS 16n .rt 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 .mk .na \fB\fBEBADF\fR\fR .ad .RS 16n .rt The \fIfildes\fR argument is not a valid open file descriptor. .RE .sp .ne 2 .mk .na \fB\fBEBUSY\fR\fR .ad .RS 16n .rt The \fIpath\fR argument is currently a mount point or has a STREAMS or doors file descriptor attached to it. .RE .sp .ne 2 .mk .na \fB\fBEINVAL\fR\fR .ad .RS 16n .rt The \fIpath\fR argument is a file in a remotely mounted directory. .RE .sp .ne 2 .mk .na \fB\fBEINVAL\fR\fR .ad .RS 16n .rt The \fIfildes\fR argument does not represent a STREAMS or doors file. .RE .sp .ne 2 .mk .na \fB\fBELOOP\fR\fR .ad .RS 16n .rt Too many symbolic links were encountered in translating \fIpath\fR. .RE .sp .ne 2 .mk .na \fB\fBENAMETOOLONG\fR\fR .ad .RS 16n .rt 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 .mk .na \fB\fBENOENT\fR\fR .ad .RS 16n .rt The \fIpath\fR argument does not exist. .RE .sp .ne 2 .mk .na \fB\fBENOTDIR\fR\fR .ad .RS 16n .rt A component of a path prefix is not a directory. .RE .sp .ne 2 .mk .na \fB\fBEPERM\fR\fR .ad .RS 16n .rt 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(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ Interface StabilityStandard _ MT-LevelMT-Safe .TE .SH SEE ALSO .sp .LP \fBfdetach\fR(1M), \fBchmod\fR(2), \fBmount\fR(2), \fBstat\fR(2), \fBdoor_create\fR(3C), \fBfdetach\fR(3C), \fBisastream\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5), \fBstreamio\fR(7I) .sp .LP \fISTREAMS Programming Guide\fR