Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Mar 2014 03:57:33 +0000 (UTC)
From:      Eitan Adler <eadler@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r263103 - stable/9/sys/compat/linprocfs
Message-ID:  <201403130357.s2D3vXIC068361@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403130357.s2D3vXIC068361>