]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
make ‘struct pthread’ a complete type
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 19 Jul 2023 21:09:26 +0000 (14:09 -0700)
committerArjun Shankar <arjun@redhat.com>
Mon, 18 Mar 2024 10:45:19 +0000 (11:45 +0100)
* nptl/descr.h (struct pthread): Remove end_padding member, which
made this type incomplete.
(PTHREAD_STRUCT_END_PADDING): Stop using end_padding.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
(cherry picked from commit 3edc4ff2ceff4a59587ebecb94148d3bcfa1df62)

nptl/descr.h

index 5cacb286f35da5d2e252b6fd4e0fa0bf166d126d..70cf4b639a3437138f2f67c48df006e62cab568c 100644 (file)
@@ -405,11 +405,11 @@ struct pthread
   /* rseq area registered with the kernel.  */
   struct rseq rseq_area;
 
-  /* This member must be last.  */
-  char end_padding[];
-
+  /* Amount of end padding, if any, in this structure.
+     This definition relies on rseq_area being last.  */
 #define PTHREAD_STRUCT_END_PADDING \
-  (sizeof (struct pthread) - offsetof (struct pthread, end_padding))
+  (sizeof (struct pthread) - offsetof (struct pthread, rseq_area) \
+   + sizeof (struct rseq))
 } __attribute ((aligned (TCB_ALIGNMENT)));
 
 static inline bool