When you write "Unix" do mean a particular set of Unix implementations, or do 
you mean that certification by The Open Group <http://www.opengroup.org/> 
requires it? If the later, shouldn't there be an APAR on this?


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Discussion List <IBM-MAIN@listserv.ua.edu> on behalf of 
Thomas David Rivers <riv...@dignus.com>
Sent: Tuesday, March 13, 2018 11:33 AM
To: IBM-MAIN@listserv.ua.edu
Subject: Re: USS assembler program and envars

Frank Chu wrote:

> Hi,
>
> Does anybody know if there is a control block chain that I can walk to
> find all of the envars that are define?  I know there is a LE C
> function that can query for a specified envar but I can't use LE C.
> And there are circumstances where I do not have access to the parm
> list pointer that is passed to the executing program, so I can't rely
> on that guy to find the envars.  I've also gone through the USS
> Callable Assembler Services Guide and it doesn't look like there is a
> service for this either.
>
> Thanks in advance.
> Frank
>
Just FYI - in a UNIX environment the address of the incoming environment
variable array
is stuffed away in an external variable named "environ":

  extern char **environ;

The Dignus C runtime (also non-LE) makes that available... basically at
the start-up of an
exec'd program you have to copy the incoming variables into a blob of memory
and point 'environ' to the blob... (because the format from IBM doesn't
match
the UNIXy way of doing it.)

Then, your program can merrily reference 'environ' (getenv/setenv,
etc... also
just reference 'environ'.)

If you are a non-LE program that has been exec'd; you probably want to take
the same approach and make those copies when you start execution; then
provide
functions that can reference the copies (e.g. your own getenv/setenv
functions.)

There is no "magic" to these environment variables - they are simply passed
on the exec() call... that's how they pass from parent-to-child in the
UNIX environmnt.
No need for a defined location beyond the per-program copy (and that
copy is up to
the program.)

   - Dave R. -

--
riv...@dignus.com                        Work: (919) 676-0847
Get your mainframe programming tools at 
http://secure-web.cisco.com/1yv1SBdrUxM_Et9wyycsLgdZSNj8tm0S1ueixX8COmlgQ952gVClA4cAebBGU-DHHGU6IbHUM0UOIt7zxQvGStv26OAGg76O5hrGMxgnryQLoDWUXIzQEUEN5BPUJt9oSrGawSWUV2cLvTaL24xYAT24IQPlRoZ3IJuhRikp_UHJI4dUijGAz7KV7kuM6Idh22HGogg-dvMrT9kE5Q_fvkiQPPDXsF0Ft1Rs1ipL9kt2H5CJcdjo69EvWiAqjvU4oDSW3RyVlca5pwIRVCDXDcdDhZJZLSF-F7acuBdpyQNMEViXE9V3PzE3PirU5BkR84kn0jQ1CFwdQ2wItRRhobAhCLIAV4SPz57nzIklS2tsOoJHBlQpUKKNAkjlAEpDXMDBkAZX2sXQSAOfRa5ec3PGwfkYn2k1Z_jZGfY-6kbninNGr6ArS9eCDHvPaLHSx/http%3A%2F%2Fwww.dignus.com

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to