From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41468) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ta66h-0003Dp-C9 for qemu-devel@nongnu.org; Sun, 18 Nov 2012 09:44:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ta66e-0007e5-9l for qemu-devel@nongnu.org; Sun, 18 Nov 2012 09:44:23 -0500 Received: from mail-we0-f173.google.com ([74.125.82.173]:62099) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ta66e-0007dz-3h for qemu-devel@nongnu.org; Sun, 18 Nov 2012 09:44:20 -0500 Received: by mail-we0-f173.google.com with SMTP id r1so1583405wey.4 for ; Sun, 18 Nov 2012 06:44:19 -0800 (PST) Sender: Paolo Bonzini Message-ID: <50A8F43F.2010403@redhat.com> Date: Sun, 18 Nov 2012 15:44:15 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1353159697-3922-1-git-send-email-aliguori@us.ibm.com> <50A8B87C.5000601@weilnetz.de> In-Reply-To: <50A8B87C.5000601@weilnetz.de> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] rng-random: only build on POSIX platforms List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: Anthony Liguori , qemu-devel@nongnu.org Il 18/11/2012 11:29, Stefan Weil ha scritto: > Am 17.11.2012 14:41, schrieb Anthony Liguori: >> There is no /dev/random on win32. >> >> Cc: Stefan Weil >> Signed-off-by: Anthony Liguori >> --- >> backends/Makefile.objs | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/backends/Makefile.objs b/backends/Makefile.objs >> index 875eebc..8836761 100644 >> --- a/backends/Makefile.objs >> +++ b/backends/Makefile.objs >> @@ -1 +1,2 @@ >> -common-obj-y += rng.o rng-random.o rng-egd.o >> +common-obj-y += rng.o rng-egd.o >> +common-obj-$(CONFIG_POSIX) += rng-random.o > > The patch fixes a build issue on w32 / w64, but the reason given > is misleading: yes, Windows has no /dev files, but the MinGW > library tries to emulate the most important interfaces from /dev. Ah, I thought that was only MSYS and Cygiwin, not MinGW. > There is a /dev/random with MinGW, and it does what it is supposed > to do. See this URL for more supported "devices": > http://srv.onzk.net/linwin/apache-php3-mysql/CygWin_20b_98-4_Documents_OnLine/CygWin-Ug-Net/using-specialnames.html But a properly-implemented /dev/random will block more often than not, so it is not a good idea to use a "fake" O_NONBLOCK. Using native Win32 crypto APIs is a much better idea. Paolo