Subject: cygwin b20.1 thinks it's 1970!???
From: [email-masked] (Thomas Langenback)

13 Jan 1999 04:57:06 -0800
Message-ID: <[email-masked]>
Reply-To: [email-masked]
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: [email-masked]

I'm real confused about this, and would appreciate any help that could
be offered...

The following code (snipped and pieced together from a much larger
program), when compiled with CYGWIN B18, and later on a Linux box,
produces the expected results.  However, when compiled with B20, it
says:

> The current time is Fri Jan 16 02:31:17 1970

> #include <sys/types.h>
> #include <sys/time.h>
> #include <ctype.h>
> #include <errno.h>
> #include <stdio.h>
> #include <string.h>
> #include <stdlib.h>
> #include <stdarg.h>
> #include <time.h>
> 
> 
> int main( int argc, char **argv )
> {
>     time_t		    current_time;
>     char *time;
>     struct timeval now_time;
>     /*
>      * Init time.
>      */
>     gettimeofday( &now_time, NULL );
>     current_time 	= (time_t) now_time.tv_sec;
>     time = ctime(&current_time);
>     time[strlen(time)-1] = '\0';
>     
>     fprintf(stderr, "The current time is %s\n\r", time);
>     return 0;
> }
> 

Any idea why?

Forgive me if the answer is something really obvious... I'm still in the
process of learning C.  This would be the reason I got the CYGWIN
compiler in the first place.

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".