Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Sep 2000 14:27:14 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Greg Lehey <grog@lemis.com>
Cc:        John Baldwin <jhb@FreeBSD.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/libkern arc4random.c
Message-ID:  <Pine.BSF.4.21.0009121422040.653-100000@besplex.bde.org>
In-Reply-To: <20000912093140.S19431@wantadilla.lemis.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 12 Sep 2000, Greg Lehey wrote:

> On Monday, 11 September 2000 at 19:10:20 +1100, Bruce Evans wrote:
> > On Sun, 10 Sep 2000, John Baldwin wrote:
> >
> >> jhb         2000/09/10 22:51:58 PDT
> >>
> >>   Modified files:
> >>     sys/libkern          arc4random.c
> >>   Log:
> >>   Add #include's of sys/proc.h and sys/param.h to silence a warning.
> >>
> >>   Revision  Changes    Path
> >>   1.5       +3 -1      src/sys/libkern/arc4random.c
> >
> > #include's shouldn't be added or unsorted to work around new
> > misimplementations in headers.  (<sys/random.h> now has a gratuitous
> > dependency on <sys/proc.h> because it doesn't forward-declare
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > "struct proc".  <sys/ktr.h> has a not-so-gratuitous dependency on
    ^^^^^^^^^^^^^
> > <sys/systm.h> because it calls snprintf().  We hacked around the
> > corresponding problem for macros that call panic() by declaring
> > panic() in the wrong place.)
> 
> What's the correct solution?

See above for <sys/random.h>.  <sys/random.h> is also missing some
declarations:

---
diff -c2 random.h~ random.h
*** random.h~	Mon Sep 11 23:09:05 2000
--- random.h	Tue Sep 12 01:47:13 2000
***************
*** 32,35 ****
--- 32,37 ----
  #ifdef _KERNEL
  
+ struct proc;
+ 
  u_int read_random(struct proc *, void *, u_int);
  
***************
*** 37,40 ****
--- 39,44 ----
  		ENTROPYSOURCE };
  void random_harvest(void *, u_int, u_int, u_int, enum esource);
+ void random_set_wakeup(int *var, int value);
+ void random_set_wakeup_exit(int *var, int value, int exitval);
  
  #endif
---

This doesn't fix the style bugs.

<sys/ktr.h> should probably declare snprintf() if it uses it.

Bruce



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0009121422040.653-100000>