avc_netlink_loop - Online Linux Manual PageSection : 3
Updated : 30 Mar 2009
Source :
Note : SELinux API documentation

NAMEavc_netlink_open, avc_netlink_close, avc_netlink_acquire_fd, avc_netlink_release_fd, avc_netlink_check_nb, avc_netlink_loop − SELinux netlink processing

SYNOPSIS#include <selinux/selinux.h>
#include <selinux/avc.h> int avc_netlink_open(int blocking); void avc_netlink_close(void); int avc_netlink_acquire_fd(void); void avc_netlink_release_fd(void); void avc_netlink_loop(void); int avc_netlink_check_nb(void);

DESCRIPTIONThese functions enable applications to handle notification of SELinux events via netlink. The userspace AVC normally checks for netlink messages on each call to avc_has_perm(3). Applications may wish to override this behavior and check for notification separately, for example in a select(2) loop. These functions also permit netlink monitoring without requiring a call to avc_open(3). avc_netlink_open() opens a netlink socket to receive SELinux notifications. The socket descriptor is stored internally; use avc_netlink_acquire_fd(3) to take ownership of it in application code. The blocking argument controls whether the O_NONBLOCK flag is set on the socket descriptor. avc_open(3) calls this function internally, specifying non-blocking behavior. avc_netlink_close() closes the netlink socket. This function is called automatically by avc_destroy(3). avc_netlink_acquire_fd() returns the netlink socket descriptor number and informs the userspace AVC not to check the socket descriptor automatically on calls to avc_has_perm(3). If no such socket descriptor exists, avc_netlink_acquire_fd(3) will first call avc_netlink_open(3) and then return the resulting fd. avc_netlink_release_fd() returns control of the netlink socket to the userspace AVC, re-enabling automatic processing of notifications. avc_netlink_check_nb() checks the netlink socket for pending messages and processes them. Callbacks for policyload and enforcing changes will be called; see selinux_set_callback(3). This function does not block. avc_netlink_loop() 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.

RETURN VALUEavc_netlink_acquire_fd() 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 errno is set appropriately.

AUTHOROriginally KaiGai Kohei. Updated by Mike Palmiotto <mike.palmiotto@crunchydata.com>

SEE ALSOavc_open(3), selinux_set_callback(3), selinux(8)
0
Johanes Gumabo
Data Size   :   8,186 byte
man-avc_netlink_open.3Build   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   3 / 180,307
Visitor ID   :     :  
Visitor IP   :   3.137.176.238   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.