Linux: Change type of dynamic PTHREAD_STACK_MIN to size_t

Message ID 87zgueipir.fsf@oldenburg.str.redhat.com
State New
Headers show
Series
  • Linux: Change type of dynamic PTHREAD_STACK_MIN to size_t
Related show

Commit Message

Florian Weimer via Libc-alpha July 22, 2021, 10:58 a.m.
An unsigned type (instead of long int) is closer how to this constant
is usually used.

---
 sysdeps/unix/sysv/linux/bits/pthread_stack_min-dynamic.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Florian Weimer via Libc-alpha July 22, 2021, 1:24 p.m. | #1
* Florian Weimer:

> An unsigned type (instead of long int) is closer how to this constant

> is usually used.

>

> ---

>  sysdeps/unix/sysv/linux/bits/pthread_stack_min-dynamic.h | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

>

> diff --git a/sysdeps/unix/sysv/linux/bits/pthread_stack_min-dynamic.h b/sysdeps/unix/sysv/linux/bits/pthread_stack_min-dynamic.h

> index 5f5fc5f024..9218269643 100644

> --- a/sysdeps/unix/sysv/linux/bits/pthread_stack_min-dynamic.h

> +++ b/sysdeps/unix/sysv/linux/bits/pthread_stack_min-dynamic.h

> @@ -23,7 +23,7 @@

>  __BEGIN_DECLS

>  extern long int __sysconf (int __name) __THROW;

>  __END_DECLS

> -#   define PTHREAD_STACK_MIN __sysconf (__SC_THREAD_STACK_MIN_VALUE)

> +#   define PTHREAD_STACK_MIN ((size_t) __sysconf (__SC_THREAD_STACK_MIN_VALUE))

>  #  endif

>  # else

>  #  include <bits/pthread_stack_min.h>


I'm withdrawing this patch.  long int is closer to the original int
type.

Thanks,
Florian

Patch

diff --git a/sysdeps/unix/sysv/linux/bits/pthread_stack_min-dynamic.h b/sysdeps/unix/sysv/linux/bits/pthread_stack_min-dynamic.h
index 5f5fc5f024..9218269643 100644
--- a/sysdeps/unix/sysv/linux/bits/pthread_stack_min-dynamic.h
+++ b/sysdeps/unix/sysv/linux/bits/pthread_stack_min-dynamic.h
@@ -23,7 +23,7 @@ 
 __BEGIN_DECLS
 extern long int __sysconf (int __name) __THROW;
 __END_DECLS
-#   define PTHREAD_STACK_MIN __sysconf (__SC_THREAD_STACK_MIN_VALUE)
+#   define PTHREAD_STACK_MIN ((size_t) __sysconf (__SC_THREAD_STACK_MIN_VALUE))
 #  endif
 # else
 #  include <bits/pthread_stack_min.h>