Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../../../../../usr/man/man3c/clock_settime.3c
Real path: /usr/share/man/man3c/clock_settime.3c
Zurück
'\" te .\" Portions Copyright (c) 2008, 2021, Oracle and/or its affiliates. .\" Copyright (c) 1989, AT&T. All rights reserved. .\" Copyright (c) 1992, The X/Open Company Ltd. All rights reserved. .\" Oracle gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at http://www.opengroup.org/bookstore/. .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html. This notice shall appear on any product containing this material. .TH clock_settime 3C "11 May 2021" "Oracle Solaris 11.4" "Standard C Library Functions" .SH NAME clock_settime, clock_gettime, clock_getres, timespec_get \- high-resolution clock operations .SH SYNOPSIS .LP .nf #include <time.h> \fBint\fR \fBclock_settime\fR(\fBclockid_t\fR \fIclock_id\fR, \fBconst struct timespec *\fR\fItp\fR); .fi .LP .nf \fBint\fR \fBclock_gettime\fR(\fBclockid_t\fR \fIclock_id\fR, \fBstruct timespec *\fR\fItp\fR); .fi .LP .nf \fBint\fR \fBclock_getres\fR(\fBclockid_t\fR \fIclock_id\fR, \fBstruct timespec *\fR\fIres\fR); .fi .LP .nf \fBint\fR \fBtimespec_get\fR(\fBstruct timespec *\fR\fIts\fR, \fBint\fR \fIbase\fR); .fi .SH DESCRIPTION .sp .LP The \fBclock_settime()\fR function sets the specified clock, \fIclock_id\fR, to the value specified by \fItp\fR. Time values that are between two consecutive non-negative integer multiples of the resolution of the specified clock are truncated down to the smaller multiple of the resolution. .sp .LP The \fBclock_gettime()\fR function returns the current value \fItp\fR for the specified clock, \fIclock_id\fR. .sp .LP The resolution of any clock can be obtained by calling \fBclock_getres()\fR. Clock resolutions are system-dependent and cannot be set by a process. If the argument \fIres\fR is not \fINULL\fR, the resolution of the specified clock is stored in the location pointed to by \fIres\fR. If \fIres\fR is \fINULL\fR, the clock resolution is not returned. If the time argument of \fBclock_settime()\fR is not a multiple of \fIres\fR, then the value is truncated to a multiple of \fIres\fR. .sp .LP A clock may be systemwide (that is, visible to all processes) or per-process (measuring time that is meaningful only within a process). .sp .LP A \fIclock_id\fR of \fBCLOCK_REALTIME\fR is defined in <\fBtime.h\fR>. This clock represents the realtime clock for the system. For this clock, the values returned by \fBclock_gettime()\fR and specified by \fBclock_settime()\fR represent the amount of time (in seconds and nanoseconds) since the Epoch. Additional clocks may also be supported. The interpretation of time values for these clocks is unspecified. .sp .LP A \fIclock_id\fR of \fBCLOCK_HIGHRES\fR represents the non-adjustable, high-resolution clock for the system. For this clock, the value returned by \fBclock_gettime\fR(3C) represents the amount of time (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 of \fBadjtime\fR(2), \fBntp_adjtime\fR(2), \fBsettimeofday\fR(3C), or \fBclock_settime()\fR. The time source for this clock is the same as that for \fBgethrtime\fR(3C). .sp .LP A \fIclock_id\fR of \fBCLOCK_PROCESS_CPUTIME_ID\fR represents the CPU-time clock of the calling process when invoking one of the clock_*() or timer_*() functions. .sp .LP A \fIclock_id\fR of \fBCLOCK_THREAD_CPUTIME_ID\fR represents the CPU-time clock associated with the calling thread when invoking one of the clock_*() or timer_*() functions. .sp .LP The \fBtimespec_get()\fR function modifies the timespec object pointed to by \fIts\fR to hold the current calendar time, based on the defined time \fIbase\fR. If \fIbase\fR is \fBTIME_UTC\fR, \fBtv_sec\fR is set to the number of seconds since \fBepoch\fR, truncated to a whole value. The implementation defines \fBepoch\fR, in this case, standard UNIX epoch January 1, 1970. \fBtv_nsec\fR is set to the integral number of nanoseconds, rounded to the resolution of the system clock. The \fBtimespec_get()\fR function is specified in the C11 standard (INCITS/ISO/IEC 9899:2011). .sp .LP Additional clocks may also be supported. The interpretation of time values for these clocks is unspecified. .SH RETURN VALUES .sp .LP Upon successful completion, the \fBclock_settime()\fR, \fBclock_gettime()\fR, and \fBclock_getres()\fR functions return \fB0\fR. Otherwise, \fB-1\fR is returned and \fBerrno\fR is set to indicate the error. .sp .LP Upon successful completion, the \fBtimespec_get()\fR function returns the nonzero value of \fIbase\fR, otherwise, \fB0\fR is returned. .SH ERRORS .sp .LP The \fBclock_settime()\fR, \fBclock_gettime()\fR, \fBclock_getres()\fR, and \fBtimespec_get()\fR functions will fail if: .sp .ne 2 .mk .na \fB\fBEINVAL\fR\fR .ad .RS 10n .rt The \fIclock_id\fR argument does not specify a known clock, or the \fIbase\fR argument does not specify a known time base. .RE .sp .ne 2 .mk .na \fB\fBENOSYS\fR\fR .ad .RS 10n .rt The functions \fBclock_settime()\fR, \fBclock_gettime()\fR, and \fBclock_getres()\fR are not supported by this implementation. .RE .sp .LP The \fBclock_settime()\fR function will fail if: .sp .ne 2 .mk .na \fB\fBEINVAL\fR\fR .ad .RS 10n .rt The \fItp\fR argument to \fBclock_settime()\fR is outside the range for the given clock ID; or the \fItp\fR argument specified a nanosecond value less than zero or greater than or equal to 1000 million. .RE .sp .LP The \fBclock_settime()\fR function may fail if: .sp .ne 2 .mk .na \fB\fBEPERM\fR\fR .ad .RS 13n .rt The requesting process does not have the appropriate privilege to set the specified clock. .RE .sp .ne 2 .mk .na \fB\fBEINTR\fR\fR .ad .RS 13n .rt The calling process belongs to a non-global zone and receive a signal while setting the time. .RE .sp .ne 2 .mk .na \fB\fBECANCELED\fR\fR .ad .RS 13n .rt The calling process belongs to a non-global zone and there exists an internal I/O error. .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(7) for descriptions of the following attributes: .sp .TS tab( ) box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPE ATTRIBUTE VALUE _ Interface Stability Committed _ MT-Level \fBclock_gettime()\fR is Async-Signal-Safe _ Standard See \fBstandards\fR(7). .TE .sp .SH SEE ALSO .sp .LP \fBtime\fR(2), \fBctime\fR(3C), \fBgethrtime\fR(3C), \fBtimer_gettime\fR(3C), \fBtimespeccmp\fR(3C), \fBclock_getcpuclockid\fR(3C), \fBpthread_getcpuclockid\fR(3C), \fBtime.h\fR(3HEAD), \fBattributes\fR(7), \fBstandards\fR(7)