This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: arguments to main


On Wed, 2002-07-31 at 01:46, Andrew Lunn wrote:
> On Wed, Jul 31, 2002 at 12:44:22AM +0200, Wouter Cloetens wrote:
> > On Fri, Jul 26, 2002 at 02:52:19AM -0700, NavEcos wrote:
> > > On Friday 26 July 2002 00:47, Martin Buck wrote:
> > > > Tracy Jones wrote:
> > > > > available.  I understand that the synthetic target does not make an
> > > > > attempt to
> > > > > preserve command line args, but is there a way to "hack" it in there?
> > > 
> > > The code is essentially GPL..
> > > 
> > > go ahead and do it :)
> > 
> > That's the spirit. I just did it for ecos 1.3.1 last week. The patch is
> > attached. My approach was to actually pick up argc and argv properly
> > in the entry code, and setting the global variables linux_argc and
> > linux_argv to hold them.
> > Here's the patch:
> 
> In terms of name space muddying, i think it would be better to call
> these variables cyg_hal_argv, and cyg_hal_argc. They are more
> generic. Its possible that in the future other synthetic targets may
> appear, eg OpenBSD, NT, etc all of which could use these generic
> names.
> 
> Hummm. Have a look at
> /packages/language/c/libc/stdlib/current/src/getenv.c. There is
> already a global variable
> 
> externC char **environ;
> 
> so maybe you can also get this from the invocation code as the third
> parameter and set it.

Additionally, these variables should be exported via some HAL .h file,
possibly <cyg/hal/hal.h> or maybe <cyg/hal/hal_arch.h>.

Finally, there should be appropriate ChangeLog entries.


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]