Blame sysdeps/nptl/lowlevellock-futex.h

Packit Service 82fcde
/* Low-level locking access to futex facilities.  Stub version.
Packit Service 82fcde
   Copyright (C) 2014-2018 Free Software Foundation, Inc.
Packit Service 82fcde
   This file is part of the GNU C Library.
Packit Service 82fcde
Packit Service 82fcde
   The GNU C Library is free software; you can redistribute it and/or
Packit Service 82fcde
   modify it under the terms of the GNU Lesser General Public
Packit Service 82fcde
   License as published by the Free Software Foundation; either
Packit Service 82fcde
   version 2.1 of the License, or (at your option) any later version.
Packit Service 82fcde
Packit Service 82fcde
   The GNU C Library is distributed in the hope that it will be useful,
Packit Service 82fcde
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 82fcde
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 82fcde
   Lesser General Public License for more details.
Packit Service 82fcde
Packit Service 82fcde
   You should have received a copy of the GNU Lesser General Public
Packit Service 82fcde
   License along with the GNU C Library.  If not, see
Packit Service 82fcde
   <http://www.gnu.org/licenses/>.  */
Packit Service 82fcde
Packit Service 82fcde
#ifndef _LOWLEVELLOCK_FUTEX_H
Packit Service 82fcde
#define _LOWLEVELLOCK_FUTEX_H   1
Packit Service 82fcde
Packit Service 82fcde
#include <errno.h>
Packit Service 82fcde
Packit Service 82fcde
Packit Service 82fcde
/* Values for 'private' parameter of locking macros.  Note pthreadP.h
Packit Service 82fcde
   optimizes for these exact values, though they are not required.  */
Packit Service 82fcde
#define LLL_PRIVATE     0
Packit Service 82fcde
#define LLL_SHARED      128
Packit Service 82fcde
Packit Service 82fcde
Packit Service 82fcde
/* For most of these macros, the return value is never really used.
Packit Service 82fcde
   Nevertheless, the protocol is that each one returns a negated errno
Packit Service 82fcde
   code for failure or zero for success.  (Note that the corresponding
Packit Service 82fcde
   Linux system calls can sometimes return positive values for success
Packit Service 82fcde
   cases too.  We never use those values.)  */
Packit Service 82fcde
Packit Service 82fcde
Packit Service 82fcde
/* Wait while *FUTEXP == VAL for an lll_futex_wake call on FUTEXP.  */
Packit Service 82fcde
#define lll_futex_wait(futexp, val, private) \
Packit Service 82fcde
  lll_futex_timed_wait (futexp, val, NULL, private)
Packit Service 82fcde
Packit Service 82fcde
/* Wait until a lll_futex_wake call on FUTEXP, or TIMEOUT elapses.  */
Packit Service 82fcde
#define lll_futex_timed_wait(futexp, val, timeout, private)             \
Packit Service 82fcde
  -ENOSYS
Packit Service 82fcde
Packit Service 82fcde
/* This macro should be defined only if FUTEX_CLOCK_REALTIME is also defined.
Packit Service 82fcde
   If CLOCKBIT is zero, this is identical to lll_futex_timed_wait.
Packit Service 82fcde
   If CLOCKBIT has FUTEX_CLOCK_REALTIME set, then it's the same but
Packit Service 82fcde
   TIMEOUT is counted by CLOCK_REALTIME rather than CLOCK_MONOTONIC.  */
Packit Service 82fcde
#define lll_futex_timed_wait_bitset(futexp, val, timeout, clockbit, private) \
Packit Service 82fcde
  -ENOSYS
Packit Service 82fcde
Packit Service 82fcde
/* Wake up up to NR waiters on FUTEXP.  */
Packit Service 82fcde
#define lll_futex_wake(futexp, nr, private)                             \
Packit Service 82fcde
  -ENOSYS
Packit Service 82fcde
Packit Service 82fcde
/* Wake up up to NR_WAKE waiters on FUTEXP.  Move up to NR_MOVE of the
Packit Service 82fcde
   rest from waiting on FUTEXP to waiting on MUTEX (a different futex).  */
Packit Service 82fcde
#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \
Packit Service 82fcde
  -ENOSYS
Packit Service 82fcde
Packit Service 82fcde
/* Wake up up to NR_WAKE waiters on FUTEXP and NR_WAKE2 on FUTEXP2.  */
Packit Service 82fcde
#define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2, private) \
Packit Service 82fcde
  -ENOSYS
Packit Service 82fcde
Packit Service 82fcde
Packit Service 82fcde
/* Like lll_futex_wait (FUTEXP, VAL, PRIVATE) but with the expectation
Packit Service 82fcde
   that lll_futex_cmp_requeue_pi (FUTEXP, _, _, MUTEX, _, PRIVATE) will
Packit Service 82fcde
   be used to do the wakeup.  Confers priority-inheritance behavior on
Packit Service 82fcde
   the waiter.  */
Packit Service 82fcde
#define lll_futex_wait_requeue_pi(futexp, val, mutex, private) \
Packit Service 82fcde
  lll_futex_timed_wait_requeue_pi (futexp, val, NULL, 0, mutex, private)
Packit Service 82fcde
Packit Service 82fcde
/* Like lll_futex_wait_requeue_pi, but with a timeout.  */
Packit Service 82fcde
#define lll_futex_timed_wait_requeue_pi(futexp, val, timeout, clockbit, \
Packit Service 82fcde
                                        mutex, private)                 \
Packit Service 82fcde
  -ENOSYS
Packit Service 82fcde
Packit Service 82fcde
/* Like lll_futex_requeue, but pairs with lll_futex_wait_requeue_pi
Packit Service 82fcde
   and inherits priority from the waiter.  */
Packit Service 82fcde
#define lll_futex_cmp_requeue_pi(futexp, nr_wake, nr_move, mutex,       \
Packit Service 82fcde
                                 val, private)                          \
Packit Service 82fcde
  -ENOSYS
Packit Service 82fcde
Packit Service 82fcde
Packit Service 82fcde
#endif  /* lowlevellock-futex.h */