•  Back 
  •  GEMDOS Function Reference 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  %About 
  •  Show info about hypertext 
  •  View a new file 
Topic       : The ATARI Compendium
Author      : Scott Sanders / JAY Software
Version     : 1.25 (20/6/2003)
Subject     : Documentation
Nodes       : 1117
Index Size  : 32614
HCP-Version : 6
Compiled on : Atari
@charset    : UTF-8
@lang       : en
@default    : 
@help       : %About
@options    : +g -i -t4 +y +z
@width      : 100
View Ref-FileSsystem()
Tsettimeofday()
Tgettimeofday()                                                      GEMDOS

Syntax

LONG Tgettimeofday( tv, tzp)
timeval *tv;
timezone *tzp;

Function      Tgettimeofday() interrogates the state of the internal, high
              resolution system clock.

Opcode        341 (0x0155)

Availability  Available when a MiNT kernel of a version at least 1.15.0
              release is detected.

Parametres    The argument tv is a pointer to the following structure:

                          struct timeval
                          {
                              long int tv_sec;
                              long int tv_usec;
                          };

              tv_sec holds the number of seconds elapsed since the epoch.
              The epoch is Thu, Jan 1 1970 00:00:00 UTC.

              tv_usec holds the fractional part of tv_sec measured in
              microseconds. The argument tzp is a pointer to another
              structure:

                          struct timezone
                          {
                              long int tz_minuteswest;
                              long int tz_dsttime;
                          };

              tz_minuteswest holds the offset to UTC in seconds.
              Timezones east of the zero-meridian (e.g. Eastern Europe)
              have a negative offset, timezones west of the zero-meridian
              (e.g. America) have a positive one.

              tz_dsttime is non-zero, if daylight savings time applies
              during some part of the year.

              You may safely pass NULL for either argument. This isn't
              considered an error.

Binding       pea     tzp
              pea     tv
              move.w  #$0155,-(sp)
              trap    #1
              lea     $0a(sp),sp

Caveats       Implementors of library bindings should be aware that the
              definition of struct timezone is non-standard. The members
              are actually int and not long int (this applies only to
              struct timezone; the members of struct timeval are always
              long). 16-bit libraries will have to copy the contents of
              the structure that tzp points to.

Comments      The Ssystem() call has a command S_CLOCKMODE. This command
              allows to retrieve or set the kernel clock mode, i.e. to
              specify whether the hardware clock is meant to run in UTC
              or in local time.

              It is planned to make MiNT compliant with the kernel time
              keeping model described in RFC1305. This model is already
              successfully implemented in operating systems such as
              SunOS, Ultrix, OSF/1, HP-UX and Linux. Please expect the
              internal realization to change in the future.

See Also      Ssystem(), Tsettimeofday()