DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

MSOP_RTODC(D2psm)


MSOP_RTODC, MSOP_WTODC -- read and write date and time in the Real Time Clock

Synopsis

   ms_bool_t pfxrtodc(ms_daytime_t *cur_time)
   ms_bool_t pfxwtodc(ms_daytime_t *cur_time)

Description

MSOP_RTODC returns the current date and time stored in the Real Time Clock (RTC) into *cur_time. MSOP_WTODC writes the indicated value into the RTC. Both operations return MS_TRUE if successful.

The ms_daytime_t structure is defined as follows:

   typedef struct(
     unsigned long dt_day       /* absolute Julian day */
     unsigned long dt_centisec  /* 100ths of seconds into the day */
   ) ms_daytime_t;
For the convenience of the PSM, the time of day can also be represented in another form, ms_xdate_t:
   typedef struct(
     unsigned short xd_year       /* full year (e.g. 1997) */
     unsigned short xd_month      /* 1=JAN */
     unsigned short xd_day        /* day in month, from 1*/
     unsigned short xd_hour       /* 0 - 23 */
     unsigned short xd_min        /* 0 - 59 */
     unsigned short xd_sec        /* 0 - 59 */
     unsigned long xd_centisec    /* 100ths of seconds into second */
   ) ms_xdate_t;
MSOP_RTODC must return the time in ms_daytime_t form. If the hardware format is closer to ms_xdate_t, it may be easier to convert it first to ms_xdate_t then convert it to ms_daytime_t.

Arguments


cur_time
the returned current date and time

Return values

MSOP_RTODC returns the following values:

MS_FALSE
the RTC device is not accessible, and the time is not valid

MS_TRUE
the RTC device is accessible, and the time is valid

MSOP_WTODC returns the following values:


MS_FALSE
the RTC device is not accessible, and the time has not been set

MS_TRUE
the RTC device is accessible, and the time has been set

Usage

Hardware applicability

All.

Version applicability

psm: 2
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - 19 June 2005