9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] ARG_MAX of Plan9
@ 2012-05-02  0:30 arisawa
  2012-05-02  0:54 ` Charles Forsyth
  2012-05-02 10:11 ` cinap_lenrek
  0 siblings, 2 replies; 3+ messages in thread
From: arisawa @ 2012-05-02  0:30 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Hello 9fans,

I have a question: what is the value of ARG_MAX of Plan9?

In Mac/OSX, the value is defined in /usr/include/sys/syslimits.h:
#define	ARG_MAX		   (256 * 1024)    /* max bytes for an exec function */

In APE, we can find the value in Plan9 source.
/sys/include/ape/sys/limits.h:
#define	ARG_MAX		16384

However, I couldn't find ARG_MAX of Plan9.

Kenji Arisawa




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9fans] ARG_MAX of Plan9
  2012-05-02  0:30 [9fans] ARG_MAX of Plan9 arisawa
@ 2012-05-02  0:54 ` Charles Forsyth
  2012-05-02 10:11 ` cinap_lenrek
  1 sibling, 0 replies; 3+ messages in thread
From: Charles Forsyth @ 2012-05-02  0:54 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 510 bytes --]

It's limited by the size of the temporary stack during exec, and
platform-specific.
The smallest seems to be 100 4k pages (less space for argv and Tos, I
suppose).
Newer variants of the system raise that to the size of the stack segment
(eg, 16 Mbytes),
which is still platform-specific. In fact, glancing at sysproc.c, I'm not
sure why it's limited
to TSTKSIZ given it goes on to allocate a much bigger segment to put them
in,
but even if that could easily be removed, currently that is the limit.

[-- Attachment #2: Type: text/html, Size: 585 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9fans] ARG_MAX of Plan9
  2012-05-02  0:30 [9fans] ARG_MAX of Plan9 arisawa
  2012-05-02  0:54 ` Charles Forsyth
@ 2012-05-02 10:11 ` cinap_lenrek
  1 sibling, 0 replies; 3+ messages in thread
From: cinap_lenrek @ 2012-05-02 10:11 UTC (permalink / raw)
  To: 9fans

as far as i can see, its just limited by this:
    /*
	 * Build the stack segment, putting it in kernel virtual for the moment
	 */
	if(spage > TSTKSIZ)
		error(Enovmem);

in pc/mem.h:55: #define	TSTKSIZ 	100			/* pages in new stack; limits exec args */

so that will give you arround half a megabyte for program
arguments.

--
cinap



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-02 10:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-02  0:30 [9fans] ARG_MAX of Plan9 arisawa
2012-05-02  0:54 ` Charles Forsyth
2012-05-02 10:11 ` cinap_lenrek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).