From 331c6e8a184167dd21a9f0b3fc165aeefea6eeca Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Tue, 19 May 2020 12:32:39 +0200 Subject: nptl: Add __pthread_attr_copy for copying pthread_attr_t objects Also add the private type union pthread_attr_transparent, to reduce the amount of casting that is required. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- nptl/pthreadP.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'nptl/pthreadP.h') diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h index f218b01574..41b693d034 100644 --- a/nptl/pthreadP.h +++ b/nptl/pthreadP.h @@ -580,6 +580,12 @@ extern void __wait_lookup_done (void) attribute_hidden; # define PTHREAD_STATIC_FN_REQUIRE(name) __asm (".globl " #name); #endif +/* Make a deep copy of the attribute *SOURCE in *TARGET. *TARGET is + not assumed to have been initialized. Returns 0 on success, or a + positive error code otherwise. */ +int __pthread_attr_copy (pthread_attr_t *target, const pthread_attr_t *source); +libc_hidden_proto (__pthread_attr_copy) + /* Returns 0 if POL is a valid scheduling policy. */ static inline int check_sched_policy_attr (int pol) -- cgit 1.4.1