*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> cap_get_fd (3c)              
Title
Content
Arch
Section
 

Contents


CAP_GET_FD(3C)							CAP_GET_FD(3C)


NAME    [Toc]    [Back]

     cap_get_fd, cap_set_fd - get or set the capabilities for an open file

SYNOPSIS    [Toc]    [Back]

     #include <sys/capability.h>

     cap_t cap_get_fd(int fd);
     int cap_set_fd(int	fd, cap_t cap);

DESCRIPTION    [Toc]    [Back]

     cap_get_fd	returns	a pointer to an	allocated cap_t	associated with	the
     open file referred	to by fd. If there is no capability set	associated
     with the file, cap_get_fd returns a NULL pointer and sets errno to
     ENOATTR.

     cap_set_fd	sets the capabilities for the open file	referred to by fd from
     the cap_t cap.  For this function to succeed, the process calling it must
     have the CAP_SETFCAP capability enabled and either	the effective user ID
     of	the process must match the file	owner or the calling process must have
     the effective CAP_FOWNER capability flag set. In addition,	if _POSIX_MAC
     is	defined, then the process must have MAC	write access to	the file.

RETURN VALUES    [Toc]    [Back]

     cap_get_fd	returns	a pointer to an	allocated cap_t	if successful, NULL
     otherwise.	 The storage should be freed with a call to cap_free with the
     returned pointer as an argument when it is	no longer needed.

     cap_set_fd	returns	0 if successful, -1 otherwise.

ERRORS    [Toc]    [Back]

     cap_get_fd:

     ENOATTR	     There is no capability set	associated with	the file.

     EACCESS	     Access to the object is denied.

     EBADF	     fd	is not a valid file descriptor.

     ENOMEM	     allocation	of the cap_t failed.

     ENOSYS	     Capability	support	is not available (not installed).

     cap_set_fd:

     EACCESS	     Access to the object is denied.

     EBADF	     fd	is not a valid file descriptor.

     EINVAL	     cap is not	valid






									Page 1






CAP_GET_FD(3C)							CAP_GET_FD(3C)



     ENOSYS	     Capability	support	is not available (not installed).

     EPERM	     The process does not have appropriate privilege or	does
		     not meet other restrictions imposed by the	implementation
		     to	perform	the operation.

     EROFS	     fd	refers to a file on a read only	file system.

SEE ALSO    [Toc]    [Back]

      
      
     capabilities(4)


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
acucap Tru64 Automatic call unit capabilities file
cap_from_text IRIX convert a POSIX capabilities string to internal form, convert capabilities to a POSIX capabilities string, or
cap_acquire IRIX make permitted set capabilities effective or remove effective capabilities
AFidentifyfd IRIX retrieve the audio file format of a file descriptor / open AFfilehandle
SlaToIv IRIX convert an SLA format file into an Open Inventor 2.0 file.
IvToRib IRIX convert an Open Inventor 2.0 file to a Renderman .rib file
eof IRIX Check for end-of-file condition on open file
acl_get_fd IRIX get or set the ACL associated with an open file
open IRIX Open a file
VOP_CLOSE FreeBSD open or close a file
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service