+struct udev_device *udev_device_new_from_synthetic_event(struct udev *udev, const char *syspath, const char *action) {
+ struct udev_device *ret;
+ int r;
+
+ if (!action) {
+ errno = EINVAL;
+ return NULL;
+ }
+
+ ret = udev_device_new_from_syspath(udev, syspath);
+ if (!ret)
+ return NULL;
+
+ r = udev_device_read_uevent_file(ret);
+ if (r < 0) {
+ udev_device_unref(ret);
+ errno = -r;
+ return NULL;
+ }
+
+ r = udev_device_set_action(ret, action);
+ if (r < 0) {
+ udev_device_unref(ret);
+ errno = -r;
+ return NULL;
+ }
+
+ return ret;
+}
+