getenv

getenv

Post by Aaron Cra » Wed, 03 Feb 1999 04:00:00





> I have a number of c functions contained in a solaris library *.so.  My
> functions are failing when they call getenv to translate variables setup
> in .profile.  The functions are called from a c background process When I
> call these functions through a test program on line they work ok

Show us the code.  It's effectively impossible to help you if we have no
information.  One suggestion, though: make sure you check the return value
of getenv() before dereferencing through it.

--

 
 
 

getenv

Post by Joe Durusa » Thu, 04 Feb 1999 04:00:00


    True enough about the code, but since he says 'background' process,
maybe he means something started with cron, such that the environment
is not what he expected it to be.

Speaking only for myself,

Joe Durusau




> > I have a number of c functions contained in a solaris library *.so.  My
> > functions are failing when they call getenv to translate variables setup
> > in .profile.  The functions are called from a c background process When I
> > call these functions through a test program on line they work ok

> Show us the code.  It's effectively impossible to help you if we have no
> information.  One suggestion, though: make sure you check the return value
> of getenv() before dereferencing through it.

> --



 
 
 

1. C problem with getenv under AIX

I'm posting here as well as comp.lang.c as I wonder if this is an AIX
problem.

I have AIX C and am trying to use the function getenv. This is the
compile time error I get:
""tmp.ec", line 13.8: 1506-068 (W) Operation between types "unsigned
char*" and "int" is not allowed.

And here is the code. From my reading I have declared the variable to
take the return value of getenv() correctly.

Any suggestions appreciated. Well here's the code

#include <string.h>
#include <stdio.h>
#include <stdarg.h>

main(argc, argv)
int argc;
char *argv[];
{
char  *homedir;

homedir=getenv("HOME");

Sent via Deja.com http://www.deja.com/
Before you buy.

2. reading damaged CDs

3. getenv("PWD")?

4. SIGALRM while in SIGALRM handler

5. Reentrancy of getenv() and putenv() ?

6. IF_ENQUEUE and IF_DEQUEUE

7. putenv & getenv

8. BusLogic cacheing controller question AGAIN

9. calling getenv before main()

10. getenv(), LD_LIBRARY_PATH and setuid

11. gcc 3.2.x redhat 8.0 c++ getenv() crash

12. HTTP getenv("") question

13. putenv and getenv