| Deutsch English Français Italiano |
|
<2025Jan23.082412@mips.complang.tuwien.ac.at> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: anton@mips.complang.tuwien.ac.at (Anton Ertl) Newsgroups: comp.arch Subject: Re: stack sizes, Segments Date: Thu, 23 Jan 2025 07:24:12 GMT Organization: Institut fuer Computersprachen, Technische Universitaet Wien Lines: 25 Message-ID: <2025Jan23.082412@mips.complang.tuwien.ac.at> References: <bdZeP.23664$Hfb1.16566@fx46.iad> <vmbsvr$3lpar$1@dont-email.me> <vme199$4g29$1@dont-email.me> <b3h0pjhe3gpa84hev3ffbsmq9d3fmcfs49@4ax.com> <vmpml9$1inh$1@gal.iecc.com> <20250122152543.00000682@yahoo.com> <iL7kP.72726$oCrf.34929@fx33.iad> <20250123014516.00006d99@yahoo.com> <WCgkP.917153$DPl.591279@fx13.iad> Injection-Date: Thu, 23 Jan 2025 09:10:07 +0100 (CET) Injection-Info: dont-email.me; posting-host="6989dc083b91c8ffbf9160be9bc4dae3"; logging-data="1632140"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+bnvVJ37V9thBeeHddhtRz" Cancel-Lock: sha1:Bzo6Q2wrEkCHyfp+D0ePF2iC5F8= X-newsreader: xrn 10.11 Bytes: 2098 scott@slp53.sl.home (Scott Lurndal) writes: >What would an application (portable or otherwise) use the process >stack base address for? Finding roots for garbage collection. >The data is available through the /proc/ filesystem. > >$ cat /proc/$$/maps | grep "[stack]" > >7fff77b52000-7fff77b73000 rw-p 00000000 00:00 0 [stack] That's Linux (I just tried it on AIX 7.3.3; there is no /proc/$$/maps). For the kind of application under discussion Linux also has /proc/self/maps, so you don't need to getpid() and convert it to decimal, but in the example that would produce the maps of the "cat" process, not that of the surrounding shell. I would use "grep -F", because grep by default searches for regexp and '[' and ']' are regexp meta-characters. - anton -- 'Anyone trying for "industrial quality" ISA should avoid undefined behavior.' Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>