Udev::FFI::Monitor
use Udev::FFI; my $udev = Udev::FFI->new() or die("Can't create Udev::FFI object: $@"); my $monitor = $udev->new_monitor() or die("Can't create udev monitor: $@"); $monitor->filter_by_subsystem_devtype('usb'); $monitor->start(); for (;;) { my $device = $monitor->poll(); # blocking read print('ACTION: '.$device->get_action()."\n"); print('SYSNAME: '.$device->get_sysname()."\n"); print('DEVPATH: '.$device->get_devpath()."\n"); }
Set the size of the kernel socket buffer. This call needs the appropriate privileges to succeed.
Returns: 1 on success, otherwise 0 on error.
Udev::FFI main Udev::FFI documentation
To install Udev::FFI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Udev::FFI
CPAN shell
perl -MCPAN -e shell install Udev::FFI
For more information on module installation, please visit the detailed CPAN module installation guide.