diff options
author | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2019-11-06 20:53:33 +0000 |
---|---|---|
committer | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2019-11-06 20:53:33 +0000 |
commit | 044ab55e41712a07fcec3e803eda03cf9cb36c60 (patch) | |
tree | 00b17582c8598947022c48010e25dccb906b9fa0 /sys/compat/linux/linux.c | |
parent | fcb71d3f8e6290b37dfc9404409c8a9174663565 (diff) | |
download | src-044ab55e41712a07fcec3e803eda03cf9cb36c60.tar.gz src-044ab55e41712a07fcec3e803eda03cf9cb36c60.zip |
Make linux(4) create /dev/shm. Linux applications often expect
a tmpfs to be mounted there, and because they like to verify it's
actually a mountpoint, a symlink won't do.
Reviewed by: dchagin (earlier version)
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20333
Notes
Notes:
svn path=/head/; revision=354413
Diffstat (limited to 'sys/compat/linux/linux.c')
-rw-r--r-- | sys/compat/linux/linux.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sys/compat/linux/linux.c b/sys/compat/linux/linux.c index fa1e8f315f9e..621efaf3a4ab 100644 --- a/sys/compat/linux/linux.c +++ b/sys/compat/linux/linux.c @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/systm.h> +#include <sys/conf.h> #include <sys/ctype.h> #include <sys/jail.h> #include <sys/lock.h> @@ -129,6 +130,12 @@ static int linux_to_bsd_sigtbl[LINUX_SIGTBLSZ] = { SIGSYS /* LINUX_SIGSYS */ }; +static struct cdev *dev_shm_cdev; +static struct cdevsw dev_shm_cdevsw = { + .d_version = D_VERSION, + .d_name = "dev_shm", +}; + /* * Map Linux RT signals to the FreeBSD RT signals. */ @@ -524,3 +531,23 @@ out: free(kosa, M_SONAME); return (error); } + +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, 0, "shm/.mountpoint"); + if (error != 0) { + printf("%s: failed to create device node, error %d\n", + __func__, error); + } +} + +void +linux_dev_shm_destroy(void) +{ + + destroy_dev(dev_shm_cdev); +} |