delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/02/12/13:01:43

From: Damian Yerrick <MYNAMEISd_yerrick AT hotmail DOT comNO2CANNEDHAM>
Newsgroups: comp.os.msdos.programmer,comp.os.msdos.djgpp
Subject: Re: Uptime and entropy in DOS
Organization: Pin Eight Software http://pineight.8m.com/
Message-ID: <591baskf2ns6u0n0l6kp8rgml7aa2q80la@4ax.com>
References: <lra6ascbh1fu2d4738d44h09kpooc8ecta AT 4ax DOT com> <38A5583C DOT EDF375B4 AT is DOT elta DOT co DOT il>
X-Newsreader: Forte Agent 1.7/32.534
MIME-Version: 1.0
Lines: 24
X-Trace: /K0ZEEybRFcnamG/1zoGYF1oPBCaFzTHSN9vBnl/ImMUutuLhTJiAw61PYMMlIbbsX8Ksp/mcJWM!JDtwOluynZ+Ux6iBnrznBKbJCdK86wDZoGmCUXU7WXGnBUsH+GtqFIhmXmC3+sXrS7cC0PfB4B/c!OvRjoMg=
X-Complaints-To: abuse AT gte DOT net
X-Abuse-Info: Please be sure to forward a copy of ALL headers
X-Abuse-Info: Otherwise we will be unable to process your complaint properly
NNTP-Posting-Date: Sat, 12 Feb 2000 16:13:10 GMT
Distribution: world
Date: Sat, 12 Feb 2000 16:13:10 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

On Sat, 12 Feb 2000 14:55:24 +0200, Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
wrote:

>Damian Yerrick wrote:
>> 
>> Is it possible to get the uptime of a DOS system?  I need more entropy
>> than the 32 bits I get from time(NULL) to initialize a pseudorandom
>> number generator.
>
>Did you try `uclock' or `gettiomeofday'?  It's in the FAQ (section 22.23).

uclock() won't work because it measures uptime of the current process,
which is *known* when the process starts, which is when I seed my PRNG
and start Allegro.  And because Allegro reprograms the timer, I can't
reseed from uclock() after the program starts.

gettimeofday() won't work because it in theory can be calculated from
time(NULL), which I'm already using, and adds no entropy.

-- 
Damian Yerrick  http://yerricde.tripod.com/
Comment on story ideas: http://home1.gte.net/frodo/quickjot.html
AOL is sucks! Find out why: http://anti-aol.org/faqs/aas/
View full sig: http://www.rose-hulman.edu/~yerricde/sig.html

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019