From: Eli Zaretskii Newsgroups: comp.os.msdos.djgpp Subject: Re: `void main' in Gnu packages---?! Date: Sat, 15 Jan 2000 23:47:59 +0200 Organization: NetVision Israel Lines: 26 Message-ID: <3880EB0F.6916DEA@is.elta.co.il> References: <200001151704 DOT LAA11959 AT darwin DOT sfbr DOT org> NNTP-Posting-Host: ras1-p22.rvt.netvision.net.il Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.netvision.net.il 947972979 11246 62.0.172.24 (15 Jan 2000 21:49:39 GMT) X-Complaints-To: abuse AT netvision DOT net DOT il NNTP-Posting-Date: 15 Jan 2000 21:49:39 GMT X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en,ru,hebrew To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Jeff Williams wrote: > > So, on DOS, it doesn't seem that `time' could report much of > interest, anyway. Perhaps you could enhance getrusage so that `time' *does* report useful info. It's not too hard, really. You need: - hooks in dosexec.c, just before a child program is launched and after it exits, to record time spent in the child process; - hook in __dpmi_int, int86, and their ilk, to record ``system'' time used by the process; - hooks in _read and _write, to record I/O usage statistics; - a simple counter in dpmiexcp.c, to record the number of signals delivered to the process; - a counter in __dpmi_yield, to record the number of ``voluntary'' context switches. Since the memory footprint of a DJGPP program can only grow, the maximum resident set size, data size, stack size etc. can be easily computed from the current limit of the DS selector and other variables like _stklen, _etext, _edata, the value of ESP, etc.