1pthread_condattr_getclock(S3tCa)ndard C Library Functipotnhsread_condattr_getclock(3C)
2
3
4

NAME

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

SYNOPSIS

10       cc -mt [ flag... ] file... [ library... ]
11       #include <pthread.h>
12
13       int pthread_condattr_getclock(
14            const pthread_condattr_t *restrict attr,
15            clockid_t *restrict clock_id);
16
17
18       int pthread_condattr_setclock(pthread_condattr_t *attr
19             clockid_t clock_id);
20
21

DESCRIPTION

23       The pthread_condattr_getclock() function obtains the value of the clock
24       attribute   from   the   attributes  object  referenced  by  attr.  The
25       pthread_condattr_setclock() function sets the  clock  attribute  in  an
26       initialized  attributes  object  referenced  by  attr.  If pthread_con‐
27       dattr_setclock() is called with a clock_id argument that  refers  to  a
28       CPU-time clock, the call fails.
29
30
31       The  clock  attribute is the clock ID of the clock that is used to mea‐
32       sure the timeout service  of  pthread_cond_timedwait(3C).  The  default
33       value of the clock attribute refers to the system clock.
34

RETURN VALUES

36       Upon  successful  completion,  the pthread_condattr_getclock() function
37       returns 0 and stores the value of the clock attribute of attr into  the
38       object  referenced by the clock_id argument. Otherwise, an error number
39       is returned to indicate the error.
40
41
42       Upon successful completion,  the  pthread_condattr_setclock()  function
43       returns  0.  Otherwise,  an  error  number  is returned to indicate the
44       error.
45

ERRORS

47       These functions may fail if:
48
49       EINVAL    The value specified by attr is invalid.
50
51
52
53       The pthread_condattr_setclock() function may fail if:
54
55       EINVAL    The value specified by clock_id does not  refer  to  a  known
56                 clock, or is a CPU-time clock.
57
58

ATTRIBUTES

60       See attributes(5) for descriptions of the following attributes:
61
62
63
64
65       ┌─────────────────────────────┬─────────────────────────────┐
66       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
67       ├─────────────────────────────┼─────────────────────────────┤
68       │Interface Stability          │Standard                     │
69       ├─────────────────────────────┼─────────────────────────────┤
70       │MT-Level                     │MT-Safe                      │
71       └─────────────────────────────┴─────────────────────────────┘
72

SEE ALSO

74       pthread_cond_init(3C),     pthread_cond_timedwait(3C),     pthread_con‐
75       dattr_destroy(3C), pthread_condattr_getpshared(3C), pthread_create(3C),
76       pthread_mutex_init(3C), attributes(5), standards(5)
77
78
79
80SunOS 5.11                        30 Jan 2004    pthread_condattr_getclock(3C)
Impressum