Article View: dnet.atari
Article #655Re: TOS environment
From: Martin Ibert
Date: Thu, 08 Jun 1989 21:57
Date: Thu, 08 Jun 1989 21:57
27 lines
2036 bytes
2036 bytes
In article <1243@infbs.UUCP> hafer@infbs.UUCP (Udo Hafermann) writes: >How is the TOS variable 'the-env' at 0x4BE intended to be used? >Is it possible to use this variable to build an environment which will >be recognized by shells? Yes and no. Yes, there is a way to make shells recognize an environment. No, this system variable is useless in this context (and in any I can think of, for that matter). If an application is started with the Pexec system call, a parameter called "envp" is passed. It is the address of a series of environment strings (NULL- terminated C strings, one after another), with an extra NULL character as an end marker. If you write a shell yourself, I advise you to copy the environment you get (as the third parameter to "main", if it's in C) into a private buffer of reasonable size (1 K, for example). Then you can manipulate it any way you want. The address of this buffer is passed as the "envp" parameter to all applications started from the shell. Further information and a sample shell that uses that technique are available upon request. I hope I have been helpful. -- \\ . Martin P Ibert, Westendallee 100 d, 1000 Berlin 19, West Germany // || |\ /| E-mail: martini@netmbx.UUCP, ...!unido!tub!tmpmbx!netmbx!martini || || | | | ---------------------------------------------------------------- || // "If all else fails, read the documentation!" -- (author unknown) \\
Technical Details
Message-ID:
<2914@netmbx.UUCP>Path:
arc1-ca.pugleaf.net!gmdzi!unido!tub!tmpmbx!netmbx!martiniReferences:
<1243@infbs.UUCP>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 12bdcf,9e555ac5a21dddc1 X-Google-Attributes: gid12bdcf,public X-Google-ArrivalTime: 1989-06-10 14:09:17 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!tub!tmpmbx!netmbx!martini From: martini@netmbx.UUCP (Martin Ibert) Newsgroups: dnet.atari Subject: Re: TOS environment Message-ID: <2914@netmbx.UUCP> Date: 8 Jun 89 21:57:49 GMT References: <1243@infbs.UUCP> Reply-To: martini@netmbx.UUCP (Martin Ibert) Distribution: dnet Organization: netmbx Public Access Unix, Berlin, West Germany Lines: 27 Posted: Thu Jun 8 22:57:49 1989