old_pthread_cond_init.c 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* Copyright (C) 2002-2019 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, see
  14. <http://www.gnu.org/licenses/>. */
  15. #include <errno.h>
  16. #include "pthreadP.h"
  17. #include <shlib-compat.h>
  18. #if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_3_2)
  19. int
  20. __pthread_cond_init_2_0 (pthread_cond_2_0_t *cond,
  21. const pthread_condattr_t *cond_attr)
  22. {
  23. struct pthread_condattr *icond_attr = (struct pthread_condattr *) cond_attr;
  24. /* The type of the first argument is actually that of the old, too
  25. small pthread_cond_t. We use only the first word of it, as a
  26. pointer. */
  27. cond->cond = NULL;
  28. /* We can't support PSHARED condvars in the old pthread_cond_*
  29. functions and neither clocks other than CLOCK_REALTIME. */
  30. if (icond_attr != NULL && icond_attr->value)
  31. return EINVAL;
  32. return 0;
  33. }
  34. compat_symbol (libpthread, __pthread_cond_init_2_0, pthread_cond_init,
  35. GLIBC_2_0);
  36. #endif