[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Tcc and environment

From: Rob
Subject: Re: [Tinycc-devel] Tcc and environment
Date: Sun, 7 Apr 2013 10:01:55 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Sun, Apr 07, 2013 at 12:07:19PM +1000, Darren Oakey wrote:
> I am using a system with no c compiler, no include directories - ie
> they've made some effort to stop you writing c for some reason (even
> though other languages are freely available).   I found tiny cc - and
> particularly PTS-TCC - and thought my problems were solved - hello
> world and other programs worked perfectly.
> Then I ran into a snag.
> However I try - I can't read the environment :( -    getenv, while
> appearing to be there, always returns null.  I looked at the uclibc
> source and getenv uses __environ - which is null, as is environ, if I
> do a char ** environ.   If I extend main to have void main (int argv,
> char **args, char **envp) - envp appears to be just random numbers.
> please help - anyone have any idea how I get at environment variables?
> I'm trying to use this to build a faster cgi on my web host - so
> without environment variables, I'm toast.

It's pretty hacky, but does something like this work?
If not it may be a problem with pts-tcc/statically linking with uclibc.


Attachment: env.c
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]