Update copyright notices with scripts/update-copyrights.
[glibc.git] / nptl / sysdeps / unix / sysv / linux / rtld-lowlevel.h
blob75e96707865939e709e1dd32a75f70cc0ce5ac10
1 /* Defintions for lowlevel handling in ld.so.
2 Copyright (C) 2006-2013 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
7 License as published by the Free Software Foundation; either
8 version 2.1 of the 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; if not, see
17 <http://www.gnu.org/licenses/>. */
19 #ifndef _RTLD_LOWLEVEL_H
20 #define _RTLD_LOWLEVEL_H 1
22 #include <atomic.h>
23 #include <lowlevellock.h>
26 /* Function to wait for variable become zero. Used in ld.so for
27 reference counters. */
28 #define __rtld_waitzero(word) \
29 do { \
30 while (1) \
31 { \
32 int val = word; \
33 if (val == 0) \
34 break; \
35 lll_futex_wait (&(word), val, LLL_PRIVATE); \
36 } \
37 } while (0)
40 #define __rtld_notify(word) \
41 lll_futex_wake (&(word), 1, LLL_PRIVATE)
43 #endif