1PTHREAD_CONDATTR_GETCLOCK(3PP)OSIX Programmer's ManuPaTlHREAD_CONDATTR_GETCLOCK(3P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10
11

NAME

13       pthread_condattr_getclock, pthread_condattr_setclock — get and set  the
14       clock selection condition variable attribute
15

SYNOPSIS

17       #include <pthread.h>
18
19       int pthread_condattr_getclock(const pthread_condattr_t *restrict attr,
20           clockid_t *restrict clock_id);
21       int pthread_condattr_setclock(pthread_condattr_t *attr,
22           clockid_t clock_id);
23

DESCRIPTION

25       The  pthread_condattr_getclock() function shall obtain the value of the
26       clock attribute from the attributes object referenced by attr.
27
28       The pthread_condattr_setclock() function shall set the clock  attribute
29       in   an   initialized   attributes   object  referenced  by  attr.   If
30       pthread_condattr_setclock() is called with  a  clock_id  argument  that
31       refers to a CPU-time clock, the call shall fail.
32
33       The  clock attribute is the clock ID of the clock that shall be used to
34       measure the timeout service of pthread_cond_timedwait().   The  default
35       value of the clock attribute shall refer to the system clock.
36
37       The  behavior  is undefined if the value specified by the attr argument
38       to pthread_condattr_getclock() or pthread_condattr_setclock() does  not
39       refer to an initialized condition variable attributes object.
40

RETURN VALUE

42       If  successful,  the  pthread_condattr_getclock() function shall return
43       zero and store the value of the clock attribute of attr into the object
44       referenced  by  the clock_id argument. Otherwise, an error number shall
45       be returned to indicate the error.
46
47       If successful, the pthread_condattr_setclock()  function  shall  return
48       zero;  otherwise,  an  error  number  shall be returned to indicate the
49       error.
50

ERRORS

52       The pthread_condattr_setclock() function may fail if:
53
54       EINVAL The value specified by clock_id does not refer to a known clock,
55              or is a CPU-time clock.
56
57       These functions shall not return an error code of [EINTR].
58
59       The following sections are informative.
60

EXAMPLES

62       None.
63

APPLICATION USAGE

65       None.
66

RATIONALE

68       If an implementation detects that the value specified by the attr argu‐
69       ment to pthread_condattr_getclock() or pthread_condattr_setclock() does
70       not refer to an initialized condition variable attributes object, it is
71       recommended that the function should fail and report an [EINVAL] error.
72

FUTURE DIRECTIONS

74       None.
75

SEE ALSO

77       pthread_cond_destroy(), pthread_cond_timedwait(), pthread_con‐
78       dattr_destroy(), pthread_condattr_getpshared(), pthread_create(),
79       pthread_mutex_destroy()
80
81       The Base Definitions volume of POSIX.1‐2008, <pthread.h>
82
84       Portions of this text are reprinted and reproduced in  electronic  form
85       from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
86       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
87       Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
88       cal and Electronics Engineers,  Inc  and  The  Open  Group.   (This  is
89       POSIX.1-2008  with  the  2013  Technical Corrigendum 1 applied.) In the
90       event of any discrepancy between this version and the original IEEE and
91       The  Open Group Standard, the original IEEE and The Open Group Standard
92       is the referee document. The original Standard can be  obtained  online
93       at http://www.unix.org/online.html .
94
95       Any  typographical  or  formatting  errors that appear in this page are
96       most likely to have been introduced during the conversion of the source
97       files  to  man page format. To report such errors, see https://www.ker
98       nel.org/doc/man-pages/reporting_bugs.html .
99
100
101
102IEEE/The Open Group                  2013        PTHREAD_CONDATTR_GETCLOCK(3P)
Impressum