From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <612dccebdc00c765cdb6e6d0dcb8216f@felloff.net> Date: Sun, 14 Sep 2014 06:23:49 +0200 From: cinap_lenrek@felloff.net To: 9fans@9fans.net In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] segattach in telnetd Topicbox-Message-UUID: 166b4f0c-ead9-11e9-9d60-3106f5b1d025 the + 2MB is to keep some distance to the bss (heap). the assumption might'v been that telnet will not dynamically allocate more than 2MB from the time when the segment is created. a better solution would be to just pass 0 as va. the kernel will then put the segment downwards from the stack base and finds a hole in the address space for us returning the base address from segattach(). segments cannot expand down. even the stack segment has a fixed size and uses demand paging for downwards expansion, thats why this works :) -- cinap