2021-01-02 11:32:25 -08:00
|
|
|
/* Copyright (C) 2002-2021 Free Software Foundation, Inc.
|
2002-11-26 22:50:54 +00:00
|
|
|
This file is part of the GNU C Library.
|
|
|
|
|
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
|
|
|
|
|
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
Lesser General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2012-02-09 23:18:22 +00:00
|
|
|
License along with the GNU C Library; if not, see
|
2019-09-06 22:40:42 -07:00
|
|
|
<https://www.gnu.org/licenses/>. */
|
2002-11-26 22:50:54 +00:00
|
|
|
|
|
|
|
|
#include "pthreadP.h"
|
2021-05-11 19:32:43 +02:00
|
|
|
#include <shlib-compat.h>
|
2002-11-26 22:50:54 +00:00
|
|
|
|
|
|
|
|
int
|
2015-10-20 11:54:09 +00:00
|
|
|
__pthread_attr_getstack (const pthread_attr_t *attr, void **stackaddr,
|
|
|
|
|
size_t *stacksize)
|
2002-11-26 22:50:54 +00:00
|
|
|
{
|
|
|
|
|
struct pthread_attr *iattr;
|
|
|
|
|
|
|
|
|
|
iattr = (struct pthread_attr *) attr;
|
|
|
|
|
|
|
|
|
|
/* Store the result. */
|
2014-03-05 00:11:01 -05:00
|
|
|
#if _STACK_GROWS_DOWN
|
2002-11-26 22:50:54 +00:00
|
|
|
*stackaddr = (char *) iattr->stackaddr - iattr->stacksize;
|
2014-03-05 00:11:01 -05:00
|
|
|
#else
|
|
|
|
|
*stackaddr = (char *) iattr->stackaddr;
|
|
|
|
|
#endif
|
2002-11-26 22:50:54 +00:00
|
|
|
*stacksize = iattr->stacksize;
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2021-05-11 19:32:43 +02:00
|
|
|
versioned_symbol (libpthread, __pthread_attr_getstack,
|
|
|
|
|
pthread_attr_getstack, GLIBC_2_34);
|
|
|
|
|
#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_2, GLIBC_2_34)
|
|
|
|
|
compat_symbol (libpthread, __pthread_attr_getstack,
|
|
|
|
|
pthread_attr_getstack, GLIBC_2_2);
|
|
|
|
|
#endif
|