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

Re: RFS: jabbin



On 8/25/06, Hubert Chan <hubert@uhoreg.ca> wrote:
| +#elif defined( __MACH__ )|| defined( __GNUC__ )
|        int fd=open("/dev/random",O_RDONLY);
|        read(fd,&tick,sizeof(tick));
|        closesocket(fd);

Err, I don't think that __GNUC__ actually guarantees the presence of
/dev/random.  So this patch does not seem to be correct.

(Although /dev/random, if you have it, is probably a better source of
randomness than rdtsc, or gethrtime.)

So what would be the alternative? Would we have to use a makefile hack
(e.g. test for the existence of /dev/random and set a compile flag) or
something to figure out what random seed we should use?

Also would it be OK to include this as a Debian patch, esp. because at
the moment Debian doesn't have any non-glibc ports?


| -#else
| -#     error Need some way to seed the random number generator
| -#endif
| +#endif

If it really does need a proper random seed, then you should not be
getting rid of the compilation error.  It may compile correctly, but it
will not work as intended.

I do wonder what it needs the proper random seed for though.

If anyone can come up with a solution I'll be grateful.

--
Andrew Donnellan
http://andrewdonnellan.com
http://ajdlinux.blogspot.com
Jabber - ajdlinux@jabber.org.au
GPG - hkp://subkeys.pgp.net 0x5D4C0C58
-------------------------------
Member of Linux Australia - http://linux.org.au
Debian user - http://debian.org
Get free rewards - http://ezyrewards.com/?id=23484
OpenNIC user - http://www.opennic.unrated.net



Reply to: