From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <48F4A7BA.5080300@gmx.de> Date: Tue, 14 Oct 2008 16:07:54 +0200 From: Kernel Panic User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080313 SeaMonkey/1.1.9 MIME-Version: 1.0 To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> References: <675fc0ac9205932e0a0fa591a097ae8c@quanstro.net> In-Reply-To: <675fc0ac9205932e0a0fa591a097ae8c@quanstro.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [9fans] several things Topicbox-Message-UUID: 1e2783be-ead4-11e9-9d60-3106f5b1d025 erik quanstrom wrote: >>> Are these limitations listed in some document? >>> >> I don't believe they are. >> >> It might bve nice to think there are no arbitary limits in plan9 >> as the GNU mantra, however there are not many and personally, >> working with remote servers with very long paths, I have never >> (knowingly) hit this limit. >> >> Having said this we could probably afford to up the size of pwd's >> buffer to, say, 8k to be sixteen times as sure. >> > > if you're going to all that trouble, why not make sure? > (i don't think this is worth it, personally, but if you do ...) > > #include > #include > > void > main(void) > { > char *p; > int n, s; > > for(s = 128; ; s <<= 1){ > p = malloc(s); > if(p == nil) > sysfatal("malloc"); > p[s-1] = 1; > if((getwd(p, s)) == 0) > sysfatal("pwd: %r"); > if(p[s-1] == 1) > break; > } > print("%s\n", p); > exits(0); > } > > - erik > > AAArgg!!!1111 We leak for a fraction of micro seconds! we should do realloc() here of course and free() the memory before exits() just to make it even more complex ;-) cinap