]> git.ipfire.org Git - thirdparty/glibc.git/blame - nptl/sysdeps/unix/sysv/linux/rtld-lowlevel.h
Replace FSF snail mail address with URLs.
[thirdparty/glibc.git] / nptl / sysdeps / unix / sysv / linux / rtld-lowlevel.h
CommitLineData
1100f849 1/* Defintions for lowlevel handling in ld.so.
835abc5c 2 Copyright (C) 2006, 2007 Free Software Foundation, Inc.
1100f849
UD
3 This file is part of the GNU C Library.
4
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.
9
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.
14
15 You should have received a copy of the GNU Lesser General Public
59ba27a6
PE
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
1100f849
UD
18
19#ifndef _RTLD_LOWLEVEL_H
20#define _RTLD_LOWLEVEL_H 1
21
22#include <atomic.h>
23#include <lowlevellock.h>
24
25
1100f849
UD
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; \
085a4412 35 lll_futex_wait (&(word), val, LLL_PRIVATE); \
1100f849
UD
36 } \
37 } while (0)
38
39
40#define __rtld_notify(word) \
085a4412 41 lll_futex_wake (&(word), 1, LLL_PRIVATE)
1100f849
UD
42
43#endif