LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-16-2004, 05:28 AM   #16
eshwar_ind
Member
 
Registered: Feb 2004
Location: Bangalore
Distribution: Redhat
Posts: 144

Original Poster
Rep: Reputation: 15

Sorry,
Here is that code,

int _start( )
{
extern int main( int, char **, char ** ) ;
int parg ;
int nargc ; /* command line arguments */
char **pargv ,
**penviron ;

/* getting command line arguments and environmental variables */

nargc = *( &parg + 2 );
pargv = ( char ** )( &parg + 3 );
penviron = ( char ** )( &parg + nargc + 4 );

/* call main */

/* Here you can call your own function */
main( nargc, pargv, penviron );
exit( 0 );
}

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

printf(" %d\n", argc );
printf(" %s\n", argv[ 0 ] );
printf(" %s\n", argv[ 1 ] );
printf(" %s\n", environ[ 0 ] );
return 0;

}

[root@localhost IPCPROJECT]# cc -nostartfiles check.c
[root@localhost IPCPROJECT]# ./a.out 23 34 55
4
./a.out
23
SSH_AGENT_PID=1904

------- I cant give you guarantee that it always works ------------------------
If you have any suggestions please let me know.
Bye,
Eshwar.
 
Old 05-22-2004, 12:10 AM   #17
eshwar_ind
Member
 
Registered: Feb 2004
Location: Bangalore
Distribution: Redhat
Posts: 144

Original Poster
Rep: Reputation: 15
Hi nerd!
Have seen this code!
No one has made any comments about it. Is it ok to do it .
Please reply me
Bye,
Eshwar
 
Old 05-22-2004, 12:13 PM   #18
The_Nerd
Member
 
Registered: Aug 2002
Distribution: Debian
Posts: 540

Rep: Reputation: 32
Sorry, this thread kinda went off the page and I forgot about it. Well that is pretty cool, I never knew that was possible. Well its definitly a good thing to know, though I don't know why I would ever use it. Well, thanks for the code and your time, I appreciate it.

Good job.
 
Old 05-23-2004, 02:01 AM   #19
eshwar_ind
Member
 
Registered: Feb 2004
Location: Bangalore
Distribution: Redhat
Posts: 144

Original Poster
Rep: Reputation: 15
Thanks !!!
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
encryption in CGI routine rblampain Linux - Security 3 08-12-2005 10:55 PM
Interrupt routine... Elric of Grans Programming 2 07-05-2005 07:11 PM
Please confirm backup routine LLS Linux - General 4 09-30-2003 11:30 AM
File under routine, mundane, etc. JasonSmead Programming 1 07-31-2003 03:40 PM
Shutdown routine with power button bfought Linux - Newbie 2 09-09-2002 06:23 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration