Everhart, Glenn From: mathog@seqaxp.bio.caltech.edu Sent: Wednesday, January 13, 1999 11:41 AM To: Info-VAX@Mvb.Saic.Com Subject: Re: HELP: Need Unix GETTIMEOFDAY FOr VAX GNU C... In article <19990112042748.01146.00011085@ng-ca1.aol.com>, anon314@aol.com (Anon314) writes: > >I'm new to VMS programming (and actually to C programming) and I'm porting a >program from Unix to VMS using GNU C v2.7.1 for VMS and need to know if their >is a repacement function for the Unix "gettimeofday" function as it dosen't >appear in the GNU C stuff. Here's the one used in the Xforms port to VMS. I don't recall who wrote it originally, though, and I don't know if it will work with Gnu C. (This was done before gettimeofday made it into the DEC C RTL.) Are you sure Gnu C doesn't have gettimeofday - maybe you just need to define something to pick it up???? *******gettimeofday.c************* #include int gettimeofday(struct timeval *tv, struct timezone *tz) { timeb_t tmp_time; ftime(&tmp_time); if (tv != NULL) { tv->tv_sec = tmp_time.time; tv->tv_usec = tmp_time.millitm * 1000; } if (tz != NULL) { tz->tz_minuteswest = tmp_time.timezone; tz->tz_dsttime = tmp_time.dstflag; } return (0); } /*** End gettimeofday() ***/ *******gettimeofday.c************* Regards, David Mathog mathog@seqaxp.bio.caltech.edu Manager, sequence analysis facility, biology division, Caltech ************************************************************************** * RIP VMS * **************************************************************************