diff options
author | eadler <eadler@FreeBSD.org> | 2014-03-13 03:42:00 +0000 |
---|---|---|
committer | eadler <eadler@FreeBSD.org> | 2014-03-13 03:42:00 +0000 |
commit | bb8499be4f886e8a8e8c6ebc7567eeb52e2dc815 (patch) | |
tree | b018d21abf4a1890890326402cc2b1307b9cf909 /sys/compat | |
parent | 846573e969ae01bbd4ff35b96801a33775d7eba9 (diff) | |
download | FreeBSD-src-bb8499be4f886e8a8e8c6ebc7567eeb52e2dc815.zip FreeBSD-src-bb8499be4f886e8a8e8c6ebc7567eeb52e2dc815.tar.gz |
MFC r262539:
linprocfs: add support for /sys/kernel/random/uuid
PR: kern/186187
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 28b683a..714b864 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> @@ -1336,6 +1337,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 */ @@ -1435,6 +1452,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); } |