From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 17228 invoked from network); 15 Jun 1999 22:48:32 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 15 Jun 1999 22:48:32 -0000 Received: from earth.uni-muenster.de (EARTH.UNI-MUENSTER.DE [128.176.216.227]) by mail.redhat.com (8.8.7/8.8.7) with SMTP id RAA23306 for ; Tue, 15 Jun 1999 17:57:05 -0400 Received: (from steffers@localhost) by earth.uni-muenster.de (950413.SGI.8.6.12/950213.SGI.AUTOCF) id XAA08340 for axp-list@redhat.com; Tue, 15 Jun 1999 23:50:38 +0200 From: steffers@earth.uni-muenster.de (Georg Steffers) Message-Id: <199906152150.XAA08340@earth.uni-muenster.de> Subject: Re: what does struct timeval look like on alpha ? To: axp-list@redhat.com Date: Tue, 15 Jun 1999 23:50:38 +0200 (METDST) In-Reply-To: <37665650.914DF422@voicenet.com> from "Uncle George" at Jun 15, 99 09:34:08 am X-Mailer: ELM [version 2.4 PL24 ME5a] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Ok, i try to do my best to serve this list so an answer to this too. I hope i am right, if not please tell it to me..... First, the parts of struct timeval are int, what means long because int is only an alias on this on alpha-machines. (int may be an alias to an other data-type on other machines) long and int are both 4 byte. I tried this with a simple sizeof(int) and sizeof(long) call. What exacly do you mean if you say Did you change the libc include-files?? On my system the values ARE defined as int in /usr/include/timebits.h and your code compiles and run on it very well....even if i change your l-valiable to int. Georg > > with gettimeofday() it appears that struct timeval is of int's. > > With getrusage(), timeval needs to be of long's. > > SO WHAT's the definition of timeval on the alpha with RH 6.0 & GLIBC > 2.1.x > > signed > Confused in New Jersey. > > > following Sample pgm that seg-faults if timeval is defined with int's > > typedef long jlong; > jlong gethrvtime_us(); > > #include > #include > #include > > > main() > { > long l; > l = gethrvtime_us(); > } > > jlong gethrvtime_us() > { > #if 1 > struct rusage usage; > getrusage( RUSAGE_SELF, &usage); > usage.ru_utime.tv_sec += usage.ru_stime.tv_sec; > usage.ru_utime.tv_usec += usage.ru_stime.tv_usec; > if ( usage.ru_utime.tv_usec >= 1000000 ) { > usage.ru_utime.tv_sec++; > usage.ru_utime.tv_usec -= 1000000; > }; > #if 0 > jio_fprintf(stderr,"gethrvtime:%ds%dus\n", > usage.ru_utime.tv_sec, > usage.ru_utime.tv_usec); > #endif > /* return value in microseconds */ > return((usage.ru_utime.tv_sec*1000L*1000L + > usage.ru_utime.tv_usec)); > #endif > > } > ~ > ~ > > -- > To unsubscribe: send e-mail to axp-list-request@redhat.com with > 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com >