+
+ def->create(def, NULL);
+
+}
+
+__DEFINE_LXSYSCALL3(int, ioctl, int, fd, int, req, sc_va_list, _args)
+{
+ int errno = -1;
+ struct v_fd* fd_s;
+ va_list args;
+
+ convert_valist(&args, _args);
+
+ if ((errno &= vfs_getfd(fd, &fd_s))) {
+ goto done;
+ }
+
+ struct device* dev = resolve_device(fd_s->file->inode->data);
+ if (!dev) {
+ errno = ENODEV;
+ goto done;
+ }
+
+ if (req == DEVIOIDENT) {
+ struct dev_info* devinfo = va_arg(args, struct dev_info*);
+ device_populate_info(dev, devinfo);
+ errno = 0;
+ }
+
+ if (!dev->ops.exec_cmd) {
+ errno = ENOTSUP;
+ goto done;
+ }
+
+ errno = dev->ops.exec_cmd(dev, req, args);
+
+done:
+ return DO_STATUS_OR_RETURN(errno);
+}
+
+static void
+__device_subsys_init()
+{
+ device_mobj_root = changeling_spawn(NULL, "devices");
+}
+owloysius_fetch_init(__device_subsys_init, on_sysconf);
\ No newline at end of file