diff options
author | eadler <eadler@FreeBSD.org> | 2014-02-27 00:43:10 +0000 |
---|---|---|
committer | eadler <eadler@FreeBSD.org> | 2014-02-27 00:43:10 +0000 |
commit | ea79ffcf4ba6da1e26f2b5dd7e83996c906256e4 (patch) | |
tree | 651d9da202366fc2da3a410cc3760a396244a0d7 /sys/compat | |
parent | 6765240e8d836b50e2135e928456ed8923b220ad (diff) | |
download | FreeBSD-src-ea79ffcf4ba6da1e26f2b5dd7e83996c906256e4.zip FreeBSD-src-ea79ffcf4ba6da1e26f2b5dd7e83996c906256e4.tar.gz |
linprocfs: add support for /sys/kernel/random/uuid
PR: kern/186187
Submitted by: Fernando <fernando.apesteguia@gmail.com>
MFC After: 2 weeks
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/linprocfs/linprocfs.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c index c3e5b14..04281b0 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); } |