All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] rng-random: only build on POSIX platforms
@ 2012-11-17 13:41 Anthony Liguori
  2012-11-18 10:29 ` Stefan Weil
  0 siblings, 1 reply; 3+ messages in thread
From: Anthony Liguori @ 2012-11-17 13:41 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Weil, Anthony Liguori

There is no /dev/random on win32.

Cc: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 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
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] rng-random: only build on POSIX platforms
  2012-11-17 13:41 [Qemu-devel] [PATCH] rng-random: only build on POSIX platforms Anthony Liguori
@ 2012-11-18 10:29 ` Stefan Weil
  2012-11-18 14:44   ` Paolo Bonzini
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Weil @ 2012-11-18 10:29 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: Paolo Bonzini, qemu-devel

Am 17.11.2012 14:41, schrieb Anthony Liguori:
> There is no /dev/random on win32.
>
> Cc: Stefan Weil<weil@mail.berlios.de>
> Signed-off-by: Anthony Liguori<aliguori@us.ibm.com>
> ---
>   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.

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

Regards
Stefan W.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] rng-random: only build on POSIX platforms
  2012-11-18 10:29 ` Stefan Weil
@ 2012-11-18 14:44   ` Paolo Bonzini
  0 siblings, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2012-11-18 14:44 UTC (permalink / raw)
  To: Stefan Weil; +Cc: Anthony Liguori, qemu-devel

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<weil@mail.berlios.de>
>> Signed-off-by: Anthony Liguori<aliguori@us.ibm.com>
>> ---
>>   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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-11-18 14:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-17 13:41 [Qemu-devel] [PATCH] rng-random: only build on POSIX platforms Anthony Liguori
2012-11-18 10:29 ` Stefan Weil
2012-11-18 14:44   ` Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.