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

NAME

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

SYNOPSIS

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

DESCRIPTION

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

RETURN VALUE

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

ERRORS

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

EXAMPLES

61       None.
62

APPLICATION USAGE

64       None.
65

RATIONALE

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

FUTURE DIRECTIONS

73       None.
74

SEE ALSO

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