Stream: wasi

Topic: ✔ _GNU_SOURCE and pthreads


view this post on Zulip Scott Waye (May 01 2023 at 14:17):

With the wasi-sdk-pthreads cmake config, I see there is pthread_attr_getstack but if _GNU_SOURCE is not defined, then the functions pthread_attr_get_np and pthread_getattr_np are not available, so how do you use pthread_attr_getstack as my understanding is that the pthread_attr_t must be retrieved first before passing to pthread_attr_getstack ?

view this post on Zulip Jamey Sharp (May 01 2023 at 16:02):

I don't know about the WASI side of this question, but it looks to me like POSIX only allows you to set your desired thread attributes before creating the thread, and the getter functions are so you can find out what you previously set in the attributes object you're constructing. As you've noted, pthread_getattr_np for finding out what your thread actually got is a GNU libc extension.

view this post on Zulip Scott Waye (May 01 2023 at 16:22):

Ah, I see, thanks!

view this post on Zulip Notification Bot (May 01 2023 at 16:22):

Scott Waye has marked this topic as resolved.


Last updated: Nov 22 2024 at 17:03 UTC