Re: ARG_MAX/E2BIG and environment size

From: Barry Margolin (barmar_at_alum.mit.edu)
Date: 12/17/03


Date: Wed, 17 Dec 2003 18:03:21 GMT

In article <b6_Db.135922$_M.692067@attbi_s54>,
 Mohun Biswas <m.biswas@invalid.addr> wrote:

> Standard Unix documentation (e.g. "man execve") states that E2BIG is
> returned if an exec fails because the combined length of the argument
> list and the environment is greater than ARG_MAX. Fine. But I can't see
> where the term "the environment" is defined. In particular, does it
> refer to the total size of the values alone? Or do the names count too?
> What about the '=' signs and terminating nulls - are they represented
> literally in the environment block and thus need to be counted?

The environment is one big block containing all the names, values, equal
signs, and nulls in between each value. It's the total size of all this
that matters.

-- 
Barry Margolin, barmar@alum.mit.edu
Woburn, MA


Relevant Pages

  • Re: Environment variables defined using My Computer Properties
    ... It is in memory. ... You are confusing storage with the environment. ... | registry is not the only place the the evironment is stored, only part of it is stored ... | Pointer to an environment block for the new process. ...
    (microsoft.public.windowsxp.general)
  • Re: ENV variable NOT recognized ! Reboot really necessary ????
    ... this will only change the environment block for new processes created *after* the change. ... Existing processes will keep on using their current environment block, which is the same as it was before you made the change. ... But an application needs to be written to explicitly do this; there's no mechanism in the operating system to universally update environment variables on the fly for running processes. ... For example, say you had a command prompt open, and you run a SET command to display the current variables. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: argv[0]
    ... It seems that the pointer to the environment in the PSP when ... its PSP though. ... environment block, the other is the program code. ... PSP right after the MCB so if that is not the case you have found the ...
    (comp.os.msdos.djgpp)
  • Re: argv[0]
    ... It seems that the pointer to the environment in the PSP when ... its PSP though. ... environment block, the other is the program code. ...
    (comp.os.msdos.djgpp)
  • Re: _putenv, getenv and the Registry
    ... > Any idea how to 'refresh' the Environment without a reboot? ... own environment block. ... Luckily Explorer is one of these apps, ...
    (microsoft.public.vc.language)