Content-type: text/html Man page of fattach

fattach

Section: C Library Functions (3)
Index Return to Main Contents
 

NAME

fattach - Attaches a STREAMS-based file descriptor to an object in the file system name space  

LIBRARY

Standard C Library (libc.so, libc.a)  

SYNOPSIS

#include <stropts.h>

int fattach(        int fd,
       const char *path);
 

STANDARDS

Interfaces documented on this reference page conform to industry standards as follows:

fattach(): XPG4-UNIX

Refer to the standards(5) reference page for more information about industry standards and associated tags.  

PARAMETERS

Specifies an open STREAMS-based file descriptor that is valid. Specifies the pathname of an existing ordinary file or directory.  

DESCRIPTION

The fattach() function attaches the fd file descriptor to an object in the file system name space (designated by path). A file descriptor can be attached to more than one node in the file system name space. In other words, a file is allowed to have several associated names. Until that file is detached from the node (with the fdetach() function), any later operations on path will affect that file.

The attached file's attributes (see the stat() reference page) are set according to the following scheme: The group ID, user ID, times, and permissions are set to those of path. The size as well as the device identifier are set to those of the file device designated by the fd parameter. Note that although the attributes of the attached file may change (see the chmod() reference page), the underlying object's attributes will not change accordingly. The number of links is set to 1.

The fattach() function is similar to the mount function. Rather than mounting a file system on a mount point, the fattach() function mounts a file descriptor on a mount point which may be a directory or a file.  

RETURN VALUES

Upon successful completion, the fattach() function returns a value of 0 (zero). Otherwise, it returns a value of -1, and errno is set to indicate the error.  

ERRORS

If any of the following conditions occurs, the fattach() function sets errno to the value that corresponds to the condition.

Although the user is the owner of path, the user has no write permissions for it, or the object designated by fd is locked. The fd parameter is an invalid file descriptor. The existing object specified by the path parameter is already mounted or has a file descriptor attached to it. [Digital]  The path parameter points to a location outside of the allocated address space of the process. The fd parameter refers to a socket.

[Digital]  The superblock for the file system had an incorrect magic number or an out of range block size.
[Digital]  The pathname is incorrect. When path was translated, too many symbolic links were found. [Digital]  There are too many file descriptors attached (system-wide). The pathname of an existing object specified by the path parameter does not exist or is an empty string. [Digital]  The system resources have been exhausted. The directory portion of the path parameter does not exist. The size of a pathname component is longer than NAME_MAX when _POSIX_NO_TRUNC is in effect, the pathname length is longer than PATH_MAX, or the length of the intermediate result of a pathname resolution of a symbolic link is longer than PATH_MAX. The current effective user ID is not the owner of the existing object specified by the path parameter. Another cause of the error is if the current effective user ID does not specify a user with the correct privileges.
 

RESTRICTIONS

[Digital]  The fattach() function requires that the FFM_FS kernel option be configured. See System Administration for information on configuring kernel options.  

RELATED INFORMATION

Functions: fdetach(3), isastream(3), chmod(2), stat(2), mount(2)

Commands: fdetach(8)

Interfaces: streamio(7)

Standards: standards(5) delim off


 

Index

NAME
LIBRARY
SYNOPSIS
STANDARDS
PARAMETERS
DESCRIPTION
RETURN VALUES
ERRORS
RESTRICTIONS
RELATED INFORMATION

This document was created by man2html, using the manual pages.
Time: 02:42:00 GMT, October 02, 2010