Page MenuHomeFreeBSD

D20333.id57628.diff
No OneTemporary

D20333.id57628.diff

Index: sys/compat/linux/linux_common.c
===================================================================
--- sys/compat/linux/linux_common.c
+++ sys/compat/linux/linux_common.c
@@ -29,6 +29,7 @@
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/conf.h>
#include <sys/exec.h>
#include <sys/imgact.h>
#include <sys/imgact_elf.h>
@@ -59,7 +60,32 @@
static eventhandler_tag linux_thread_dtor_tag;
static eventhandler_tag linux_exit_tag;
+static struct cdev *dev_shm_cdev;
+static struct cdevsw dev_shm_cdevsw = {
+ .d_version = D_VERSION,
+ .d_name = "dev_shm",
+};
+static void
+linux_dev_shm_create(void)
+{
+ int error;
+
+ error = make_dev_p(MAKEDEV_CHECKNAME | MAKEDEV_WAITOK, &dev_shm_cdev,
+ &dev_shm_cdevsw, NULL, UID_ROOT, GID_WHEEL, 0600, "shm/shm");
+ if (error != 0) {
+ printf("%s: failed to create device node, error %d",
+ __func__, error);
+ }
+}
+
+static void
+linux_dev_shm_destroy(void)
+{
+
+ destroy_dev(dev_shm_cdev);
+}
+
static int
linux_common_modevent(module_t mod, int type, void *data)
{
@@ -67,6 +93,7 @@
switch(type) {
case MOD_LOAD:
+ linux_dev_shm_create();
linux_osd_jail_register();
linux_exit_tag = EVENTHANDLER_REGISTER(process_exit,
linux_proc_exit, NULL, 1000);
@@ -78,6 +105,7 @@
linux_device_register_handler(*ldhp);
break;
case MOD_UNLOAD:
+ linux_dev_shm_destroy();
linux_osd_jail_deregister();
SET_FOREACH(ldhp, linux_device_handler_set)
linux_device_unregister_handler(*ldhp);

File Metadata

Mime Type
text/plain
Expires
Wed, Dec 25, 11:28 PM (10 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15599481
Default Alt Text
D20333.id57628.diff (1 KB)

Event Timeline