142 lines
4.1 KiB
HTML
142 lines
4.1 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of avc_netlink_loop</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>avc_netlink_loop</H1>
|
|
Section: SELinux API documentation (3)<BR>Updated: 30 Mar 2009<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
avc_netlink_open, avc_netlink_close, avc_netlink_acquire_fd,
|
|
avc_netlink_release_fd, avc_netlink_check_nb, avc_netlink_loop - SELinux
|
|
netlink processing
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<B>#include <<A HREF="file:///usr/include/selinux/selinux.h">selinux/selinux.h</A>></B>
|
|
|
|
<BR>
|
|
|
|
<B>#include <<A HREF="file:///usr/include/selinux/avc.h">selinux/avc.h</A>></B>
|
|
|
|
<P>
|
|
<B>int avc_netlink_open(int </B><I>blocking</I><B>);</B>
|
|
|
|
<P>
|
|
<B>void avc_netlink_close(void);</B>
|
|
|
|
<P>
|
|
<B>int avc_netlink_acquire_fd(void);</B>
|
|
|
|
<P>
|
|
<B>void avc_netlink_release_fd(void);</B>
|
|
|
|
<P>
|
|
<B>void avc_netlink_loop(void);</B>
|
|
|
|
<P>
|
|
<B>int avc_netlink_check_nb(void);</B>
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
These functions enable applications to handle notification of SELinux events
|
|
via netlink. The userspace AVC normally checks for netlink messages on each
|
|
call to
|
|
<B><A HREF="/cgi-bin/man/man2html?3+avc_has_perm">avc_has_perm</A></B>(3).
|
|
|
|
Applications may wish to override this behavior and check for notification
|
|
separately, for example in a
|
|
<B><A HREF="/cgi-bin/man/man2html?2+select">select</A></B>(2)
|
|
|
|
loop. These functions also permit netlink monitoring without requiring a
|
|
call to
|
|
<B><A HREF="/cgi-bin/man/man2html?3+avc_open">avc_open</A></B>(3).
|
|
|
|
<P>
|
|
<B>avc_netlink_open</B>()
|
|
|
|
opens a netlink socket to receive SELinux notifications. The socket
|
|
descriptor is stored internally; use
|
|
<B><A HREF="/cgi-bin/man/man2html?3+avc_netlink_acquire_fd">avc_netlink_acquire_fd</A></B>(3)
|
|
|
|
to take ownership of it in application code. The
|
|
<I>blocking</I>
|
|
|
|
argument controls whether the O_NONBLOCK flag is set on the socket descriptor.
|
|
<B><A HREF="/cgi-bin/man/man2html?3+avc_open">avc_open</A></B>(3)
|
|
|
|
calls this function internally, specifying non-blocking behavior.
|
|
<P>
|
|
<B>avc_netlink_close</B>()
|
|
|
|
closes the netlink socket. This function is called automatically by
|
|
<B><A HREF="/cgi-bin/man/man2html?3+avc_destroy">avc_destroy</A></B>(3).
|
|
|
|
<P>
|
|
<B>avc_netlink_acquire_fd</B>()
|
|
|
|
returns the netlink socket descriptor number and informs the userspace AVC
|
|
not to check the socket descriptor automatically on calls to
|
|
<B><A HREF="/cgi-bin/man/man2html?3+avc_has_perm">avc_has_perm</A></B>(3).
|
|
|
|
<P>
|
|
<B>avc_netlink_release_fd</B>()
|
|
|
|
returns control of the netlink socket to the userspace AVC, re-enabling
|
|
automatic processing of notifications.
|
|
<P>
|
|
<B>avc_netlink_check_nb</B>()
|
|
|
|
checks the netlink socket for pending messages and processes them.
|
|
Callbacks for policyload and enforcing changes will be called;
|
|
see
|
|
<B><A HREF="/cgi-bin/man/man2html?3+selinux_set_callback">selinux_set_callback</A></B>(3).
|
|
|
|
This function does not block.
|
|
<P>
|
|
<B>avc_netlink_loop</B>()
|
|
|
|
enters a loop blocking on the netlink socket and processing messages as they
|
|
are received. This function will not return unless an error occurs on
|
|
the socket, in which case the socket is closed.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>RETURN VALUE</H2>
|
|
|
|
<B>avc_netlink_acquire_fd</B>()
|
|
|
|
returns a non-negative file descriptor number on success. Other functions
|
|
with a return value return zero on success. On error, -1 is returned and
|
|
<I>errno</I>
|
|
|
|
is set appropriately.
|
|
<A NAME="lbAF"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?3+avc_open">avc_open</A></B>(3),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?3+selinux_set_callback">selinux_set_callback</A></B>(3),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+selinux">selinux</A></B>(8)
|
|
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="2"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="3"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="4"><A HREF="#lbAE">RETURN VALUE</A><DD>
|
|
<DT id="5"><A HREF="#lbAF">SEE ALSO</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:36 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|