1PTHREAD_CONDATTR_GETCLOCK(P)POSIX Programmer's ManuaPlTHREAD_CONDATTR_GETCLOCK(P)
2
3
4

NAME

6       pthread_condattr_getclock,  pthread_condattr_setclock - get and set the
7       clock selection condition variable attribute (ADVANCED REALTIME)
8

SYNOPSIS

10       #include <pthread.h>
11
12       int pthread_condattr_getclock(const pthread_condattr_t *restrict attr,
13              clockid_t *restrict clock_id);
14       int pthread_condattr_setclock(pthread_condattr_t *attr,
15              clockid_t clock_id);
16
17

DESCRIPTION

19       The pthread_condattr_getclock() function shall obtain the value of  the
20       clock  attribute  from  the  attributes  object referenced by attr. The
21       pthread_condattr_setclock() function shall set the clock  attribute  in
22       an  initialized  attributes  object referenced by attr. If pthread_con‐
23       dattr_setclock() is called with a clock_id argument that  refers  to  a
24       CPU-time clock, the call shall fail.
25
26       The  clock attribute is the clock ID of the clock that shall be used to
27       measure the timeout service of pthread_cond_timedwait().   The  default
28       value of the clock attribute shall refer to the system clock.
29

RETURN VALUE

31       If  successful,  the  pthread_condattr_getclock() function shall return
32       zero and store the value of the clock attribute of attr into the object
33       referenced  by the clock_id argument.  Otherwise, an error number shall
34       be returned to indicate the error.
35
36       If successful, the pthread_condattr_setclock()  function  shall  return
37       zero;  otherwise,  an  error  number  shall be returned to indicate the
38       error.
39

ERRORS

41       These functions may fail if:
42
43       EINVAL The value specified by attr is invalid.
44
45
46       The pthread_condattr_setclock() function may fail if:
47
48       EINVAL The value specified by clock_id does not refer to a known clock,
49              or is a CPU-time clock.
50
51
52       These functions shall not return an error code of [EINTR].
53
54       The following sections are informative.
55

EXAMPLES

57       None.
58

APPLICATION USAGE

60       None.
61

RATIONALE

63       None.
64

FUTURE DIRECTIONS

66       None.
67

SEE ALSO

69       pthread_cond_destroy()   ,   pthread_cond_timedwait()   ,  pthread_con‐
70       dattr_destroy()   ,   pthread_condattr_getpshared()   ,1   pthread_con‐
71       dattr_init()  ,  pthread_condattr_setpshared()  ,1  pthread_create()  ,
72       pthread_mutex_init()    ,    the    Base    Definitions    volume    of
73       IEEE Std 1003.1-2001, <pthread.h>
74
76       Portions  of  this text are reprinted and reproduced in electronic form
77       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
78       --  Portable  Operating  System  Interface (POSIX), The Open Group Base
79       Specifications Issue 6, Copyright (C) 2001-2003  by  the  Institute  of
80       Electrical  and  Electronics  Engineers, Inc and The Open Group. In the
81       event of any discrepancy between this version and the original IEEE and
82       The  Open Group Standard, the original IEEE and The Open Group Standard
83       is the referee document. The original Standard can be  obtained  online
84       at http://www.opengroup.org/unix/online.html .
85
86
87
88IEEE/The Open Group                  2003         PTHREAD_CONDATTR_GETCLOCK(P)
Impressum