7 #include <libmnl/libmnl.h>
8 #include <linux/netlink.h>
10 int main(
int argc,
char *argv[])
13 char buf[MNL_SOCKET_BUFFER_SIZE];
16 nl = mnl_socket_open(NETLINK_KOBJECT_UEVENT);
18 perror(
"mnl_socket_open");
23 if (mnl_socket_bind(nl, (1<<0), MNL_SOCKET_AUTOPID) < 0) {
24 perror(
"mnl_socket_bind");
28 ret = mnl_socket_recvfrom(nl, buf,
sizeof(buf));
39 ret = mnl_socket_recvfrom(nl, buf,
sizeof(buf));