UdevContext UdevDevice::getContext(void) { /* Get the udev context and reference it: */ udev* context=udev_device_get_udev(device); udev_ref(context); /* Return a context object: */ return UdevContext(context); }
UdevContext UdevMonitor::getContext(void) { /* Get the context and reference it: */ udev* context=udev_monitor_get_udev(monitor); udev_ref(context); /* Return a context object: */ return UdevContext(context); }
UdevContext UdevContext::NewRef() { { ScopeLock protect(udev_context_mutex); if (nullptr == udev_root_context) { udev_root_context = new UdevContext(udev_new()); assert(udev_root_context); } } return UdevContext(*udev_root_context); }