TIME-SYS

    Since:

    1.0

    Version:

    1.0

    Summary

    Files

    Data Structures

    Data Structure Name

    Description

    Describes a period of time, accurate to microseconds.

    timespec

    Describes a period of time, accurate to nanoseconds.

    Describes a timer.

    timezone

    Describes a time zone.

    Macro Name and Value

    Description

    ITIMER_REAL    0

    Defines the timer that runs in real time.

    Functions

    Function Name

    Description

    gettimeofday (struct __restrict value, void restrict ovalue)

    int 

    Obtains the system time and time zone.

    int 

    Obtains the value of an intermittent timer.

    setitimer (int w, const struct restrict value, struct itimerval __restrict ovalue)

    int 

    Sets the value for a timer.

    (const struct timeval tv, const struct *tz)

    int 

    Sets the system time and time zone.

    Details

    Function Documentation

    Description:

    Obtains the value of an intermittent timer.

    Parameters:

    Returns:

    Returns 0 if the operation is successful; returns -1 and sets errno to a value in the following table if the operation fails.

    errno

    Description

    EINVAL

    Incorrect input or timer type.

    gettimeofday()

    Description:

    Obtains the system time and time zone.

    Parameters:

    Name

    Description

    value Indicates the pointer to the timeval structure that contains the time.
    ovalue This parameter is used for compatibility only.

    Attention:

    Currently, there is no time zone structure. The return value of ovalue is empty.

    Returns:

    Returns 0 if the operation is successful; returns -1 and sets errno to a value in the following table if the operation fails.

    errno

    Description

    EINVAL

    Incorrect input.

    setitimer()

    Description:

    Sets the value for a timer.

    Parameters:

    Returns:

    Returns 0 if the operation is successful; returns -1 and sets errno to a value in the following table if the operation fails.

    errno

    Description

    EINVAL

    Incorrect input or timer type.

    settimeofday()

    Description:

    Sets the system time and time zone.

    Parameters:

    Name

    Description

    tv Indicates the pointer to the time to set.
    tz Indicates the pointer to the time zone to set. This parameter is not used yet.

    Attention:

    tz is invalid. The time is set internally using clock_settime.

    Returns:

    Returns 0 if the operation is successful; returns -1 and sets errno to a value in the following table if the operation fails.

    errno

    Description

    EINVAL