9.5. Removed Directives#
9.5.1. CLOCK_GET - Get date and time information#
Warning
This directive was removed in RTEMS 5.1. See also Transition Advice for the Removed rtems_clock_get().
- CALLING SEQUENCE:
rtems_status_code rtems_clock_get( rtems_clock_get_options option, void *time_buffer );
- DIRECTIVE STATUS CODES:
RTEMS_SUCCESSFUL
current time obtained successfully
RTEMS_NOT_DEFINED
system date and time is not set
RTEMS_INVALID_ADDRESS
time_buffer
is NULL- DESCRIPTION:
This directive obtains the system date and time. If the caller is attempting to obtain the date and time (i.e. option is set to either
RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH
,RTEMS_CLOCK_GET_TOD
, orRTEMS_CLOCK_GET_TIME_VALUE
) and the date and time has not been set with a previous call tortems_clock_set
, then theRTEMS_NOT_DEFINED
status code is returned. The caller can always obtain the number of ticks per second (option isRTEMS_CLOCK_GET_TICKS_PER_SECOND
) and the number of ticks since the executive was initialized option isRTEMS_CLOCK_GET_TICKS_SINCE_BOOT
).The
option
argument may taken on any value of the enumerated typertems_clock_get_options
. The data type expected fortime_buffer
is based on the value ofoption
as indicated below:Option
Return type
RTEMS_CLOCK_GET_TOD
(rtems_time_of_day *)
RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH
(rtems_interval *)
RTEMS_CLOCK_GET_TICKS_SINCE_BOOT
(rtems_interval *)
RTEMS_CLOCK_GET_TICKS_PER_SECOND
(rtems_interval *)
RTEMS_CLOCK_GET_TIME_VALUE
(struct timeval *)
- NOTES:
This directive is callable from an ISR.
This directive will not cause the running task to be preempted. Re-initializing RTEMS causes the system date and time to be reset to an uninitialized state. Another call to
rtems_clock_set
is required to re-initialize the system date and time to application specific specifications.