Date: Fri, 25 Mar 2022 12:55:31 +0000 From: David Chisnall <theraven@FreeBSD.org> To: freebsd-hackers@freebsd.org Subject: Re: Getting the current thread's stack base / size on FreeBSD Message-ID: <69e08ba5-210d-eaab-2ba0-170360b307d4@FreeBSD.org> In-Reply-To: <aedca5b2-277e-8fdb-1007-353aba5a5b45@FreeBSD.org> References: <aedca5b2-277e-8fdb-1007-353aba5a5b45@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Never mind, libthr also exposes pthread_attr_get_np. I missed it because it has the same semantics as the glibc version but a slightly different spelling. David On 25/03/2022 11:41, David Chisnall wrote: > > Hi all, > > I'm trying to get the VAVM[1] WebAssembly runtime working on FreeBSD. In > its platform-specific code, they need to find the base and size of the > current stack. They have code for Linux and macOS, using different > non-standard pthread extensions, but I couldn't see a mechanism for > doing this on FreeBSD. Is there an API for this? > > Darwin provides a pair of _np APIs for getting these values. Glibc > provides an API for getting the pthread attributes for the current > thread, which is a bit more general and useful. Adding this to libthr > would be a fairly simple change, if it doesn't exist already. Am I > missing an existing mechanism? > > David > > [1] https://wavm.github.io/ >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69e08ba5-210d-eaab-2ba0-170360b307d4>