1 /* Helper code for POSIX timer implementation on Hurd.
2 Copyright (C) 2000-2023 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public License as
7 published by the Free Software Foundation; either version 2.1 of the
8 License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; see the file COPYING.LIB. If
17 not, see <https://www.gnu.org/licenses/>. */
19 #ifndef _TIMER_ROUTINES_H
20 #define _TIMER_ROUTINES_H 1
22 #include <bits/pthreadtypes.h>
24 /* Compare two pthread_attr_t thread attributes for exact equality.
25 Returns 1 if they are equal, otherwise zero if they are not equal
26 or contain illegal values. This version is Hurd-specific for
27 performance reason. One could use the access functions to get the
28 values of all the fields of the attribute structure. */
30 thread_attr_compare (const pthread_attr_t
* left
, const pthread_attr_t
* right
)
32 struct __pthread_attr
*ileft
= (struct __pthread_attr
*) left
;
33 struct __pthread_attr
*iright
= (struct __pthread_attr
*) right
;
35 return ileft
->__schedparam
.__sched_priority
36 == iright
->__schedparam
.__sched_priority
37 && ileft
->__stackaddr
== iright
->__stackaddr
38 && ileft
->__stacksize
== iright
->__stacksize
39 && ileft
->__guardsize
== iright
->__guardsize
40 && ileft
->__detachstate
== iright
->__detachstate
41 && ileft
->__inheritsched
== iright
->__inheritsched
42 && ileft
->__contentionscope
== iright
->__contentionscope
43 && ileft
->__schedpolicy
== iright
->__schedpolicy
;
46 #endif /* timer_routines.h */