Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/sys expose a way to see if random number source is enabl...



details:   https://anonhg.NetBSD.org/src/rev/30d3626f43b6
branches:  trunk
changeset: 535521:30d3626f43b6
user:      itojun <itojun%NetBSD.org@localhost>
date:      Tue Aug 20 22:30:53 2002 +0000

description:
expose a way to see if random number source is enabled, some wants it
for avoiding extra function call for rnd_add_uint32 and such.

diffstat:

 sys/sys/rnd.h |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (19 lines):

diff -r 13813b0bddde -r 30d3626f43b6 sys/sys/rnd.h
--- a/sys/sys/rnd.h     Tue Aug 20 22:06:04 2002 +0000
+++ b/sys/sys/rnd.h     Tue Aug 20 22:30:53 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rnd.h,v 1.14 2001/09/09 00:48:55 enami Exp $   */
+/*     $NetBSD: rnd.h,v 1.15 2002/08/20 22:30:53 itojun Exp $  */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -140,6 +140,9 @@
 #define        RND_EXTRACT_GOOD        1  /* return as many good bytes
                                      (short read ok) */
 
+#define RND_ENABLED(rp) \
+        (((rp)->data.flags & RND_FLAG_NO_COLLECT) == 0)
+
 void           rndpool_init __P((rndpool_t *));
 void           rndpool_init_global __P((void));
 u_int32_t      rndpool_get_entropy_count __P((rndpool_t *));



Home | Main Index | Thread Index | Old Index