aboutsummaryrefslogtreecommitdiff
path: root/sys/compat
diff options
context:
space:
mode:
authorEitan Adler <eadler@FreeBSD.org>2014-02-27 00:43:10 +0000
committerEitan Adler <eadler@FreeBSD.org>2014-02-27 00:43:10 +0000
commit9ace80105a3fc9b2215a0b5e1a7ee1ad82941fba (patch)
tree651d9da202366fc2da3a410cc3760a396244a0d7 /sys/compat
parentf0455d6562807f6477def944d2d2c525f1fc300e (diff)
Notes
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/linprocfs/linprocfs.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c
index c3e5b141f426..04281b054a83 100644
--- a/sys/compat/linprocfs/linprocfs.c
+++ b/sys/compat/linprocfs/linprocfs.c
@@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$");
#include <sys/time.h>
#include <sys/tty.h>
#include <sys/user.h>
+#include <sys/uuid.h>
#include <sys/vmmeter.h>
#include <sys/vnode.h>
#include <sys/bus.h>
@@ -1337,6 +1338,22 @@ linprocfs_dofdescfs(PFS_FILL_ARGS)
return (0);
}
+
+/*
+ * Filler function for proc/sys/kernel/random/uuid
+ */
+static int
+linprocfs_douuid(PFS_FILL_ARGS)
+{
+ struct uuid uuid;
+
+ kern_uuidgen(&uuid, 1);
+ sbuf_printf_uuid(sb, &uuid);
+ sbuf_printf(sb, "\n");
+ return(0);
+}
+
+
/*
* Constructor
*/
@@ -1436,6 +1453,11 @@ linprocfs_init(PFS_INIT_ARGS)
pfs_create_file(dir, "sem", &linprocfs_dosem,
NULL, NULL, NULL, PFS_RD);
+ /* /proc/sys/kernel/random/... */
+ dir = pfs_create_dir(dir, "random", NULL, NULL, NULL, 0);
+ pfs_create_file(dir, "uuid", &linprocfs_douuid,
+ NULL, NULL, NULL, PFS_RD);
+
return (0);
}