From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 30489 invoked from network); 15 Jan 1999 21:23:44 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 15 Jan 1999 21:23:44 -0000 Received: from netcom11.netcom.com (ram@netcom11.netcom.com [192.100.81.121]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id QAA15528 for ; Fri, 15 Jan 1999 16:00:21 -0500 Received: (from ram@localhost) by netcom11.netcom.com (8.8.5-r-beta/8.8.5/(NETCOM v1.02)) id NAA21342 for axp-list@redhat.com; Fri, 15 Jan 1999 13:00:20 -0800 (PST) Date: Fri, 15 Jan 1999 13:00:20 -0800 (PST) From: "Munagala V. S. Ramanath" Message-Id: <199901152100.NAA21342@netcom11.netcom.com> To: axp-list@redhat.com Subject: struct timeval problem Hi, Just noticed a discrepancy in RH 5.2 in the way 'struct timeval' is defined in /usr/include/timebits.H: struct timeval { int tv_sec; /* Seconds. */ int tv_usec; /* Microseconds. */ }; This seems incorrect since the man page for gettimeofday says: -------------------- gettimeofday and settimeofday can set the time as well as a timezone. tv is a timeval struct, as specified in /usr/include/sys/time.h: struct timeval { long tv_sec; /* seconds */ long tv_usec; /* microseconds */ }; -------------------- However, on RH 5.2 x86, the members are 'time_t' rather than 'int'. This means that code that previously did this: gettimeofday( &p, &q ) ; s = ctime( &p.tv_sec ) ; now needs to do this: time_t tmp ; gettimeofday( &p, &q ) ; tmp = p.tv_sec ; s = ctime( &tmp ) ; Does anyone know if this is intentional or a bug ? Thanks. Ram