Annotation of 42BSD/lib/libc/compat-4.1/ftime.c, revision 1.1.1.1

1.1       root        1: /*     ftime.c 4.1     83/05/31        */
                      2: 
                      3: #include <sys/types.h>
                      4: #include <sys/time.h>
                      5: 
                      6: /*
                      7:  * Backwards compatible ftime.
                      8:  */
                      9: 
                     10: /* from old timeb.h */
                     11: struct timeb {
                     12:        time_t  time;
                     13:        u_short millitm;
                     14:        short   timezone;
                     15:        short   dstflag;
                     16: };
                     17: 
                     18: ftime(tp)
                     19:        register struct timeb *tp;
                     20: {
                     21:        struct timeval t;
                     22:        struct timezone tz;
                     23: 
                     24:        if (gettimeofday(&t, &tz) < 0)
                     25:                return (-1);
                     26:        tp->time = t.tv_sec;
                     27:        tp->millitm = t.tv_usec / 1000;
                     28:        tp->timezone = tz.tz_minuteswest;
                     29:        tp->dstflag = tz.tz_dsttime;
                     30: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.