apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@covalent.net>
Subject Re: cvs commit: apr/file_io/unix mktemp.c
Date Tue, 12 Feb 2002 01:34:14 GMT
A question for the list - are we really working in microsecond resolutions?
(Win32 is to the nearest 10 microseconds, I'm guessing others aren't that
precise.)  If so, what would you choose as a divisor, since we could certainly
pick a better divisor than USEC_PER_SEC for randomness.

> wrowe       02/02/11 17:27:09
> 
>   Modified:    file_io/unix mktemp.c
>   Log:
>     I hope the clocks have sufficient resolution to make this randomization
>     useful.  Comments?  We may need to divide, not necessarily by USEC_PER_SEC
>     but perhaps by a nice binary value.
>   
>   Submitted by: Mladen Turk <mturk@mappingsoft.com>
>   
>   Revision  Changes    Path
>   1.21      +7 -1      apr/file_io/unix/mktemp.c
>   
>   --- mktemp.c 18 Jan 2002 19:16:29 -0000 1.20
>   +++ mktemp.c 12 Feb 2002 01:27:09 -0000 1.21
>   @@ -130,7 +136,7 @@
>        apr_uint32_t randnum;
>    
>        if (randseed==0) {
>   -        randseed = time(NULL);
>   +        randseed = (int)apr_time_now();
>            seedrandom(randseed);
>        }
>    
>   
>   
>   
> 


Mime
View raw message