svn commit: r263103 - stable/9/sys/compat/linprocfs

Eitan Adler eadler at FreeBSD.org
Thu Mar 13 03:57:34 UTC 2014


Author: eadler
Date: Thu Mar 13 03:57:33 2014
New Revision: 263103
URL: http://svnweb.freebsd.org/changeset/base/263103

Log:
  MFC r262539:
  linprocfs: add support for /sys/kernel/random/uuid
  
  PR:		kern/186187

Modified:
  stable/9/sys/compat/linprocfs/linprocfs.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/compat/linprocfs/linprocfs.c
==============================================================================
--- stable/9/sys/compat/linprocfs/linprocfs.c	Thu Mar 13 03:42:24 2014	(r263102)
+++ stable/9/sys/compat/linprocfs/linprocfs.c	Thu Mar 13 03:57:33 2014	(r263103)
@@ -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>
@@ -1347,6 +1348,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
  */
@@ -1446,6 +1463,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);
 }
 


More information about the svn-src-stable-9 mailing list