Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
MAC_GET(3)		 BSD Library Functions Manual		    MAC_GET(3)

NAME
     mac_get_file, mac_get_fd, mac_get_proc -- get the label of	a file,
     socket, socket peer or process

LIBRARY
     Standard C	Library	(libc, -lc)

SYNOPSIS
     #include <sys/mac.h>

     int
     mac_get_file(const	char *path, mac_t label);

     int
     mac_get_fd(int fd,	mac_t label);

     int
     mac_get_pid(pid_t pid, mac_t label);

     int
     mac_get_proc(mac_t	label);

DESCRIPTION
     The mac_get_file()	and mac_get_fd() functions fill	in label (which	must
     first be allocated	by mac_prepare(3)) with	the MAC	label associated with
     the file referenced by path or the	file descriptor	specified by fd, re-
     spectively.  Note that this function will fail on socket descriptors.
     For information on	getting	MAC labels on socket descriptors see
     getsockopt(2).

     The mac_get_proc()	and mac_get_pid() functions fill in label (which must
     first be allocated	by mac_prepare(3)) with	the MAC	label associated with
     the requesting process or the specified process, respectively.

ERRORS
     [EACCES]		A component of path is not searchable, or MAC read ac-
			cess to	the file is denied.

     [ENAMETOOLONG]	The pathname pointed to	by path	exceeds	PATH_MAX, or a
			component of the pathname exceeds NAME_MAX.

     [ENOENT]		A component of path does not exist.

     [ENOMEM]		Insufficient memory is available to allocate a new MAC
			label structure.

     [ENOTDIR]		A component of path is not a directory.

SEE ALSO
     mac(3), mac_free(3), mac_text(3), mac_prepare(3), mac_set(3), mac(4),
     mac(9)

STANDARDS
     POSIX.1e is described in IEEE POSIX.1e draft 17.  Discussion of the draft
     continues on the cross-platform POSIX.1e implementation mailing list.  To
     join this list, see the FreeBSD POSIX.1e implementation page for more in-
     formation.

BSD			       December	21, 2001			   BSD

NAME | LIBRARY | SYNOPSIS | DESCRIPTION | ERRORS | SEE ALSO | STANDARDS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=mac_get_file&sektion=3&manpath=FreeBSD+5.0-RELEASE>

home | help