[libc-commits] [libc] [libc] Add pthread_getstack_np extension (PR #217049)

Alexey Samsonov via libc-commits libc-commits at lists.llvm.org
Mon Aug 31 09:06:05 PDT 2026


================
@@ -130,10 +132,20 @@ static TLSDescriptor tls;
     case AT_HWCAP2:
       hwcap2 = aux_entry.val;
       break;
+    case AT_EXECFN:
+      execfn = reinterpret_cast<const char *>(aux_entry.val);
+      break;
     default:
       break; // TODO: Read other useful entries from the aux vector.
     }
   }
+  // AT_EXECFN is typically the last thing on the stack. Round it up to the
+  // next page boundary.
+  uintptr_t stack_addr =
----------------
vonosmas wrote:

I'm not sure about it yet - in particular, whether a more complicated design / new API is warranted, as I don't yet understand the possible use cases well enough :-/ I'm OK with tabling it for the time being, but maybe returning to the API discussions once we try to use threading library more extensively in large applications.

https://github.com/llvm/llvm-project/pull/217049


More information about the libc-commits mailing list