Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > F

fdetach(3C)

HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

fdetach() — detach a name from a STREAMS file descriptor

SYNOPSIS

#include <stropts.h>

int fdetach(const char *path);

DESCRIPTION

The fdetach() function detaches a file descriptor from a name in the file system designated by path. path specifies the path name of an existing object in the file system name space that was previously attached (see fattach(3C)). As a result of the fdetach() operation, the node's status and permissions return to the state prior to the file attaching to the node. Any later operations on path will affect only the file system node and not the attached file.

Security Restrictions

The fdetach() function is restricted to superusers, or users with the OWNER privilege, or those who own path and have write permission. In addition to having the OWNER privilege, DACREAD or DACWRITE privileges may also be required. See privileges(5) for more information about privileged access on systems that support fine-grained privileges.

RETURN VALUE

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

ERRORS

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

EFAULT

The path parameter points outside the process' allocated address space.

EACCES

The user does not have the correct permission to access the file. See the Security Restrictions section.

EINVAL

The object pointed to by the path parameter is not fattached to a STREAMS device or pipe.

ELOOP

When path was translated, too many symbolic links were found.

ENOENT

The path parameter points to a path name that does not exist.

ENOTDIR

The directory portion of the path parameter does not exist.

ENAMETOOLONG

The size of a path name component is longer than NAME_MAX when _POSIX_NO_TRUNC is in effect, or the path name length is longer than PATH_MAX.

EPERM

The current effective user ID is not the owner of the existing object specified by the path parameter, or the current effective user ID does not specify a user with the correct permissions.

STANDARDS CONFORMANCE

fdetach(): SVID3

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.