sl@0: /** @file ../include/sys/time.h sl@0: @internalComponent sl@0: */ sl@0: sl@0: /** @fn adjtime(const struct timeval *delta, struct timeval *olddelta) sl@0: @param delta sl@0: @param olddelta sl@0: @return A successful call will return 0 while a failure will return -1 sl@0: sl@0: sl@0: sl@0: The adjtime system call makes small adjustments to the system time (as sl@0: returned by gettimeofday ) by advancing it the amount sl@0: specified by the timeval delta . sl@0: sl@0: If delta is negative, the clock is still incremented by the positive of sl@0: delta until the correction is complete. Thus, the time is always a monotonically sl@0: increasing function and time correction from an earlier call to adjtime might not have finished when adjtime is called again. In such cases the structure pointed to by olddelta will contain, upon return, the number of microseconds still sl@0: to be corrected from the earlier call. Otherwise the values will be set to 0 sl@0: sl@0: This call may be used by time servers that synchronize the clock. sl@0: sl@0: Examples: sl@0: @code sl@0: #include sl@0: #include sl@0: int main() sl@0: { sl@0: //Fill the input struct with 100 microseconds sl@0: const struct timeval delta = {0, 100}; sl@0: struct timeval olddelta; sl@0: int retval; sl@0: retval = adjtime (δ, &olddelta;); //Call adjtime sl@0: printf("adjtime returned %d",retval); sl@0: return 0; sl@0: } sl@0: sl@0: @endcode sl@0: Output sl@0: @code sl@0: adjtime returned 0 sl@0: sl@0: @endcode sl@0: @see gettimeofday() sl@0: sl@0: sl@0: sl@0: sl@0: @publishedAll sl@0: @externallyDefinedApi sl@0: */ sl@0: sl@0: /** @fn gettimeofday(struct timeval *tp, struct timezone *tzp) sl@0: @param tp sl@0: @param tzp sl@0: @return The gettimeofday function returns 0 for success, or -1 for failure. sl@0: sl@0: The system's notion of the current Greenwich time and the current time sl@0: zone is obtained with the gettimeofday system call, and set with the settimeofday system call. sl@0: The time is expressed in seconds and microseconds sl@0: since midnight (0 hour), January 1, 1970. sl@0: The resolution of the system sl@0: clock is hardware dependent, and the time may be updated continuously or sl@0: in "ticks." sl@0: If tp or tzp is NULL, the associated time sl@0: information will not be returned or set. sl@0: sl@0: The structures pointed to by tp and tzp are defined in \#include \ as: sl@0: sl@0: @code sl@0: struct timeval { sl@0: longtv_sec;/* seconds since Jan. 1, 1970 */ sl@0: longtv_usec;/* and microseconds */ sl@0: }; sl@0: @endcode sl@0: sl@0: @code sl@0: struct timezone { sl@0: inttz_minuteswest; /* minutes west of Greenwich */ sl@0: inttz_dsttime;/* type of dst correction */ sl@0: }; sl@0: @endcode sl@0: sl@0: The timezone structure indicates the local time zone (measured in minutes of time sl@0: westward from Greenwich) and a flag that, if nonzero, indicates that Daylight sl@0: Saving time applies locally during the appropriate part of the year. sl@0: sl@0: Examples: sl@0: @code sl@0: #include sl@0: #include sl@0: sl@0: int main() sl@0: { sl@0: struct timeval *tv; sl@0: struct timezone *tz; sl@0: int i = gettimeofday(tv, tz); sl@0: sl@0: printf("tv: %d, %d", tv->tv_sec, tv->tv_usec); sl@0: printf("tz: %d, %d", tz->tz_minuteswest, tz->tz_dsttime); sl@0: return 0; sl@0: } sl@0: sl@0: @endcode sl@0: Output sl@0: @code sl@0: tv: 1474660693, -326937770 sl@0: tz: 7804688, 3 sl@0: sl@0: @endcode sl@0: @see adjtime() sl@0: @see clock_gettime() sl@0: @see ctime() sl@0: sl@0: sl@0: sl@0: sl@0: @publishedAll sl@0: @externallyDefinedApi sl@0: */ sl@0: sl@0: /** @fn utimes(const char *filename, const struct timeval *tvp) sl@0: @param filename sl@0: @param tvp sl@0: sl@0: Note: This description also covers the following functions - sl@0: lutimes() futimes() sl@0: sl@0: @return Upon successful completion, the value 0 is returned; otherwise the sl@0: value -1 is returned and the global variable errno is set to indicate the sl@0: error. sl@0: sl@0: The utimes function sets the access and modification times of the file pointed sl@0: to by the path argument to the value of the times argument. sl@0: The utimes function allows time specifications accurate to the microsecond. sl@0: sl@0: For utimes , the times argument is an array of timeval structures. The first array sl@0: member represents the date and time of last access and the second member represents the date and time of last modification. sl@0: The times in the timeval structure are measured in seconds and microseconds since the Epoch, although rounding toward sl@0: the nearest second may occur. sl@0: sl@0: If the times argument is a null pointer, the access and modification times sl@0: of the file are set to the current time. sl@0: sl@0: Examples: sl@0: @code sl@0: /* Detailed description: Sample usage of utimes system call. sl@0: * Preconditions: Example.txt file should exist in the working directory sl@0: */ sl@0: #include sl@0: #include sl@0: #include sl@0: int main() sl@0: { sl@0: struct timeval Tim[1] ; sl@0: Tim[0].tv_sec = 0 ; sl@0: Tim[0].tv_usec = 0 ; sl@0: if(utimes("Example.txt" , Tim) < 0 ) sl@0: { sl@0: printf("Utimes system call failed") ; sl@0: return -1 ; sl@0: } sl@0: printf("Utimes call succeded") ; sl@0: return 0 ; sl@0: } sl@0: sl@0: @endcode sl@0: @see stat() sl@0: @see utime() sl@0: sl@0: sl@0: sl@0: @capability Deferred @ref RFs::SetModified(const TDesC16&, const TTime&) sl@0: sl@0: @publishedAll sl@0: @externallyDefinedApi sl@0: */ sl@0: sl@0: sl@0: /** @fn bintime_addx(struct bintime *bt, uint64_t x) sl@0: sl@0: Static inline funtion. Function for reading the time. sl@0: sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: sl@0: /** @fn bintime_add(struct bintime *bt, const struct bintime *bt2) sl@0: sl@0: Static inline funtion. Function for reading the time. sl@0: sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: sl@0: /** @fn bintime_sub(struct bintime *bt, const struct bintime *bt2) sl@0: sl@0: Static inline funtion. Function for reading the time. sl@0: sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: sl@0: sl@0: /** @fn bintime2timespec(const struct bintime *bt, struct timespec *ts) sl@0: sl@0: Static inline funtion sl@0: sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: sl@0: /** @fn timespec2bintime(const struct timespec *ts, struct bintime *bt) sl@0: sl@0: Static inline funtion sl@0: sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: sl@0: /** @fn bintime2timeval(const struct bintime *bt, struct timeval *tv) sl@0: sl@0: Static inline funtion sl@0: sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: sl@0: sl@0: /** @fn timeval2bintime(const struct timeval *tv, struct bintime *bt) sl@0: sl@0: Static inline funtion sl@0: sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: sl@0: /** @struct itimerval sl@0: sl@0: Includes the following members, sl@0: sl@0: @publishedAll sl@0: @externallyDefinedApi sl@0: */ sl@0: sl@0: /** @var itimerval::it_interval sl@0: timer interval sl@0: */ sl@0: sl@0: /** @var itimerval::it_value sl@0: current value sl@0: */ sl@0: sl@0: /** @struct clockinfo sl@0: sl@0: Getkerninfo clock information structure sl@0: sl@0: @publishedAll sl@0: @externallyDefinedApi sl@0: */ sl@0: sl@0: /** @var clockinfo::hz sl@0: clock frequency sl@0: */ sl@0: sl@0: /** @var clockinfo::tick sl@0: micro-seconds per hz tick sl@0: */ sl@0: sl@0: /** @var clockinfo::spare sl@0: current value sl@0: */ sl@0: sl@0: /** @var clockinfo::stathz sl@0: statistics clock frequency sl@0: */ sl@0: sl@0: /** @var clockinfo::profhz sl@0: profiling clock frequency sl@0: */ sl@0: sl@0: sl@0: sl@0: