pub struct UEventSocket { /* private fields */ }Expand description
Socket NETLINK_KOBJECT_UEVENT recevant les notifications de hotplug.
Drop ferme le FD via [OwnedFd]. CLOEXEC est toujours activé.
Implementations§
Source§impl UEventSocket
impl UEventSocket
Sourcepub fn read<'b>(&self, buffer: &'b mut [u8]) -> Result<UEventMessage<'b>, Errno>
pub fn read<'b>(&self, buffer: &'b mut [u8]) -> Result<UEventMessage<'b>, Errno>
Lit un message uevent et le décode en place dans buffer.
Le [UEventMessage] retourné emprunte buffer : il reste valide
tant que le buffer n’est pas réutilisé. Aucune allocation.
Authenticité. Le message est rejeté ([Errno::EPERM]) si l’adresse
source n’est pas le kernel (nl_pid != 0) ou si, en mode USERSPACE,
le crédential SCM_CREDENTIALS est absent ou n’a pas uid == 0.
§Errors
- [
Errno::EPERM] : message rejeté (source non authentique). - [
Errno::EAGAIN] : socketNONBLOCK, aucun message disponible. - [
Errno::EINTR] : interrompu (remonté tel quel, ADR-021 conv. 2). - [
Errno::EBADMSG] : message indécodable (en-têtelibudevcorrompu). - [
Errno::EMSGSIZE] : message tronqué (buffer trop petit).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UEventSocket
impl RefUnwindSafe for UEventSocket
impl Send for UEventSocket
impl Sync for UEventSocket
impl Unpin for UEventSocket
impl UnsafeUnpin for UEventSocket
impl UnwindSafe for UEventSocket
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more