This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Implement non-trivial std::random_device::entropy (PR libstdc++/67578)


On 2017-05-22 14:50 +0100, Jonathan Wakely wrote:
> On 22/05/17 21:41 +0800, Xi Ruoyao wrote:
> > On 2017-05-22 14:00 +0100, Jonathan Wakely wrote:
> > > On 18/05/17 19:27 +0800, Xi Ruoyao wrote:
> > > > This patch use ioctl to get entropy of std::random_device using
> > > > /dev/random and /dev/urandom.
> > > 
> > > This is a nice addition, thanks.
> > > 
> > > N.B. I couldn't apply your patch, several lines had U+00A0 (i.e.
> > > NO-BREAK SPACE) characters where normal spaces should be. I don't know
> > > if this is something your mail client did, but maybe attaching the
> > > patch as a multipart message rather than including it inline in the
> > > body will prevent it in future.
> > 
> > Oh no...  Seems my email client destroyed my patch. I'll attach the
> > patch next time.  Please wait for PATCH v2.
> 
> OK, will do. I missed part of the required changes when adding a new
> symbol version, see the attached patch.
> 

In very old Linux kernel (1.3.x) there is random.h but not RNDGETENTCNT.
The random.h without RNDGETENTCNT was only used in the kernel internally.
But at that time Linux Makefile didn't have "headers_install" target
so user may copy all headers (including the internal ones) to /usr/include.
It seems we should check RNDGETENTCNT explicitly if we want to support
1.3.x.
-- 
Xi Ruoyao <ryxi@stu.xidian.edu.cn>
School of Aerospace Science and Technology, Xidian University


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]