| Skip Navigation Links | |
| Exit Print View | |
![]() | man pages section 3: Basic Library Functions Oracle Solaris 11 Information Library |
enable_extended_FILE_stdio(3C)
posix_spawnattr_getschedparam(3C)
posix_spawnattr_getschedpolicy(3C)
posix_spawnattr_getsigdefault(3C)
posix_spawnattr_getsigignore_np(3C)
posix_spawnattr_getsigmask(3C)
posix_spawnattr_setschedparam(3C)
posix_spawnattr_setschedpolicy(3C)
posix_spawnattr_setsigdefault(3C)
posix_spawnattr_setsigignore_np(3C)
posix_spawnattr_setsigmask(3C)
posix_spawn_file_actions_addclose(3C)
posix_spawn_file_actions_addclosefrom_np(3C)
posix_spawn_file_actions_adddup2(3C)
posix_spawn_file_actions_addopen(3C)
posix_spawn_file_actions_destroy(3C)
posix_spawn_file_actions_init(3C)
pthread_attr_getdetachstate(3C)
pthread_attr_getinheritsched(3C)
pthread_attr_getschedparam(3C)
pthread_attr_getschedpolicy(3C)
pthread_attr_setdetachstate(3C)
pthread_attr_setinheritsched(3C)
pthread_attr_setschedparam(3C)
pthread_attr_setschedpolicy(3C)
pthread_barrierattr_destroy(3C)
pthread_barrierattr_getpshared(3C)
pthread_barrierattr_setpshared(3C)
pthread_condattr_getpshared(3C)
pthread_condattr_setpshared(3C)
pthread_cond_reltimedwait_np(3C)
pthread_key_create_once_np(3C)
pthread_mutexattr_getprioceiling(3C)
pthread_mutexattr_getprotocol(3C)
pthread_mutexattr_getpshared(3C)
pthread_mutexattr_getrobust(3C)
pthread_mutexattr_setprioceiling(3C)
pthread_mutexattr_setprotocol(3C)
pthread_mutexattr_setpshared(3C)
pthread_mutexattr_setrobust(3C)
pthread_mutex_getprioceiling(3C)
pthread_mutex_reltimedlock_np(3C)
pthread_mutex_setprioceiling(3C)
pthread_rwlockattr_destroy(3C)
pthread_rwlockattr_getpshared(3C)
pthread_rwlockattr_setpshared(3C)
pthread_rwlock_reltimedrdlock_np(3C)
pthread_rwlock_reltimedwrlock_np(3C)
pthread_rwlock_timedrdlock(3C)
pthread_rwlock_timedwrlock(3C)
rctlblk_get_enforced_value(3C)
- high-resolution clock operations
#include <time.h>intclock_settime(clockid_tclock_id,const struct timespec *tp);
intclock_gettime(clockid_tclock_id,struct timespec *tp);
intclock_getres(clockid_tclock_id,struct timespec *res);
Theclock_settime() function sets the specified clock,clock_id, to the value specifiedbytp. Time values that are between two consecutive non-negative integer multiplesof the resolution of the specified clock are truncated down to the smallermultiple of the resolution.
Theclock_gettime() function returns the current valuetp for the specified clock,clock_id.
The resolution of any clock can be obtained by callingclock_getres(). Clockresolutions are system-dependent and cannot be set by a process. If theargumentres is notNULL, the resolution of the specified clock is storedin the location pointed to byres. Ifres isNULL, theclock resolution is not returned. If the time argument ofclock_settime() isnot a multiple ofres, then the value is truncated to a multipleofres.
A clock may be systemwide (that is, visible to all processes) orper-process (measuring time that is meaningful only within a process).
Aclock_id ofCLOCK_REALTIME is defined in <time.h>. This clock represents therealtime clock for the system. For this clock, the values returned byclock_gettime() and specified byclock_settime() represent the amount of time (in seconds andnanoseconds) since the Epoch. Additional clocks may also be supported. The interpretationof time values for these clocks is unspecified.
Aclock_id ofCLOCK_HIGHRES represents the non-adjustable, high-resolution clock for the system.For this clock, the value returned byclock_gettime(3C) represents the amount oftime (in seconds and nanoseconds) since some arbitrary time in the past;it is not correlated in any way to the time of day,and thus is not subject to resetting or drifting by way ofadjtime(2),ntp_adjtime(2),settimeofday(3C), orclock_settime(). The time source for this clockis the same as that forgethrtime(3C).
Additional clocks may also be supported. The interpretation of time values forthese clocks is unspecified.
Upon successful completion,0 is returned. Otherwise,-1 is returned anderrno is set to indicate the error.
Theclock_settime(),clock_gettime() andclock_getres() functions will fail if:
Theclock_id argument does not specify a known clock.
The functionsclock_settime(),clock_gettime(), andclock_getres() are not supported by this implementation.
Theclock_settime() function will fail if:
Thetp argument toclock_settime() is outside the range for the given clock ID; or thetp argument specified a nanosecond value less than zero or greater than or equal to 1000 million.
Theclock_settime() function may fail if:
The requesting process does not have the appropriate privilege to set the specified clock.
Seeattributes(5) for descriptions of the following attributes:
|
time(2),ctime(3C),gethrtime(3C),time.h(3HEAD),timer_gettime(3C),attributes(5),standards(5)
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Legal Notices | ![]() ![]() |