Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > putenv for AIX and ifdef for AIX

Reply
Thread Tools

putenv for AIX and ifdef for AIX

 
 
ClownPleco
Guest
Posts: n/a
 
      08-22-2007
I have read several posts about putenv is not Standard C. But I'm
wondering if anyone knows if it is available in AIX. All of our other
platforms (linux (32 and 64 bit), sgi, hpux, x86, darwin (intel and
mac), interix and sun) behave properly for our application. We found
that if we run this command prior to running the application, it works
correctly:

set LDR_CNTRL=MAXDATA=0x80000000;export LDR_CNTRL

Our problem is that we start a parent process that spawns the child
application. If we set the LDR_CNTRL=MAXDATA prior to starting the
parent process, other child applications are failing.

Our initial solution is to have wrap around child application that
sets the environmental variable and then spawns an additional child.
This environmental variable would only be set if the the operating
system is AIX.

Second question, does anyone know the correct #ifdef statement to
check for AIX, is it:

#ifdef __AIX__

I'm a very very green C programmer!

Thanks

Rick

 
Reply With Quote
 
 
 
 
Richard Tobin
Guest
Posts: n/a
 
      08-22-2007
In article <(E-Mail Removed) .com>,
ClownPleco <(E-Mail Removed)> wrote:

>I have read several posts about putenv is not Standard C. But I'm
>wondering if anyone knows if it is available in AIX. All of our other
>platforms (linux (32 and 64 bit), sgi, hpux, x86, darwin (intel and
>mac), interix and sun) behave properly for our application. We found
>that if we run this command prior to running the application, it works
>correctly:
>
>set LDR_CNTRL=MAXDATA=0x80000000;export LDR_CNTRL


You'd be better off asking in comp.unix.aix.

-- Richard
--
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.
 
Reply With Quote
 
 
 
 
CBFalconer
Guest
Posts: n/a
 
      08-22-2007
ClownPleco wrote:
>
> I have read several posts about putenv is not Standard C. But I'm
> wondering if anyone knows if it is available in AIX. All of our other
> platforms (linux (32 and 64 bit), sgi, hpux, x86, darwin (intel and
> mac), interix and sun) behave properly for our application. We found
> that if we run this command prior to running the application, it works
> correctly:
>
> set LDR_CNTRL=MAXDATA=0x80000000;export LDR_CNTRL
>
> Our problem is that we start a parent process that spawns the child
> application. If we set the LDR_CNTRL=MAXDATA prior to starting the
> parent process, other child applications are failing.
>
> Our initial solution is to have wrap around child application that
> sets the environmental variable and then spawns an additional child.
> This environmental variable would only be set if the the operating
> system is AIX.
>
> Second question, does anyone know the correct #ifdef statement to
> check for AIX, is it:
>
> #ifdef __AIX__
>
> I'm a very very green C programmer!


These are not C language questions. Try comp.unix.programmer (I
think).

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>


--
Posted via a free Usenet account from http://www.teranews.com

 
Reply With Quote
 
Mark Bluemel
Guest
Posts: n/a
 
      08-23-2007
ClownPleco wrote:
> I have read several posts about putenv is not Standard C. But I'm
> wondering if anyone knows if it is available in AIX.


As I happen to work extensively with AIX, in this area, I'll give you
some answers. However, I'd stress that it's off-topic for this newsgroup
- as others have suggested, it would probably be more appropriate to ask
these sort of questions in a unix newsgroup in future.

putenv(), which is part of POSIX and therefore required for
POSIX-compliant systems such as AIX, is covered in the manuals for AIX
which are available online at
<http://publib.boulder.ibm.com/infocenter/pseries/index.jsp?topic=/com.ibm.aix.doc/infocenter/base/aix53.htm>

> All of our other
> platforms (linux (32 and 64 bit), sgi, hpux, x86, darwin (intel and
> mac), interix and sun) behave properly for our application. We found
> that if we run this command prior to running the application, it works
> correctly:
>
> set LDR_CNTRL=MAXDATA=0x80000000;export LDR_CNTRL
>


See the AIX manual discussion of this option at
<http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.genprogc/doc/genprogc/lrg_prg_support.htm>

You can set this option for your executable at build time, which will
not affect its children. This would probably be more appropriate. See
the documentation for the linker (ld) and the "-bmaxdata" option.

> Our problem is that we start a parent process that spawns the child
> application. If we set the LDR_CNTRL=MAXDATA prior to starting the
> parent process, other child applications are failing.


Don't use the environment variable...

> Second question, does anyone know the correct #ifdef statement to
> check for AIX, is it:
>
> #ifdef __AIX__


I can't help you here - we usually set our own defines in the makefiles
for O/S specifics.
 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      08-23-2007
Mark Bluemel <(E-Mail Removed)> writes:
> ClownPleco wrote:
>> I have read several posts about putenv is not Standard C. But I'm
>> wondering if anyone knows if it is available in AIX.

>
> As I happen to work extensively with AIX, in this area, I'll give you
> some answers. However, I'd stress that it's off-topic for this
> newsgroup - as others have suggested, it would probably be more
> appropriate to ask these sort of questions in a unix newsgroup in
> future.

[...]

How difficult would it have been, both for you and for the OP, to take
this discussion to comp.unix aix?

--
Keith Thompson (The_Other_Keith) http://www.velocityreviews.com/forums/(E-Mail Removed) <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
 
Reply With Quote
 
Thomas Dickey
Guest
Posts: n/a
 
      08-24-2007
Richard Tobin <(E-Mail Removed)> wrote:
> In article <(E-Mail Removed) .com>,
> ClownPleco <(E-Mail Removed)> wrote:


>>I have read several posts about putenv is not Standard C. But I'm
>>wondering if anyone knows if it is available in AIX. All of our other
>>platforms (linux (32 and 64 bit), sgi, hpux, x86, darwin (intel and
>>mac), interix and sun) behave properly for our application. We found
>>that if we run this command prior to running the application, it works
>>correctly:
>>
>>set LDR_CNTRL=MAXDATA=0x80000000;export LDR_CNTRL


> You'd be better off asking in comp.unix.aix.


Not really (comp.unix.aix doesn't get much traffic from developers,
and rarely do those get a knowledgable answer - nothing that OP did
get an answer here .

Posting to comp.unix.programmer would be more likely to get results.

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use os.putenv() ? google@tyeon.com Python 5 08-30-2007 09:17 PM
getenv returns same string as putenv? Michael B Allen C Programming 8 12-13-2006 09:18 AM
putenv dpugmire@gmail.com Python 8 12-21-2005 12:34 AM
Looking for AIX 5.2 binaries, IS anyone running Ruby on AIX 5.2 ?? bww00amdahl@yahoo.com Ruby 5 07-08-2005 11:54 AM
typedef and #ifdef F. Edward Boas C++ 1 08-11-2003 05:52 PM



Advertisments