LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-25-2005, 03:17 AM   #1
supermyself
LQ Newbie
 
Registered: May 2005
Posts: 17

Rep: Reputation: 0
A problem of my web server


I have written a C progam to implement a web server.When I use the execle() function to implement CGI,the system tell me : Bad Adress.

My program can reslove cgi path ,cgi para,cgi name and some environment variables,for example:
char *cgiPath;
char *cgiName;
char *cgiPara;
char *envp[6];

cgiPath = "./cgi-bin/vote.pl";
cgiPara = "idol=B";
cgiName = "vote.pl";
envp[0] = "REQUEST_METHOD=POST";
envp[1] = "CONTENT_LENGTH=6";
envp[2] = "CONTENT_TYPE=application/x-www-form-urlencoded"

...

I call execle like this:
if (execle(cgiPath,cgiName,(char *)0,envp) = -1)
perror("execle error");



When this function is executed,an error occur:Bad adress.
then what's wrong?
 
Old 05-25-2005, 04:44 AM   #2
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 47
read these:
http://www.catb.org/~esr/faqs/smart-questions.html
http://www.chiark.greenend.org.uk/~sgtatham/bugs.html
 
  


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
problem conecting to my web server juanb Linux - General 3 10-13-2005 09:21 AM
Problem in Web server Redhat_guy Red Hat 5 06-30-2004 04:10 AM
Web Server Problem fuelinjection Linux - General 4 12-04-2003 03:52 AM
what's problem on my web server? exper Linux - Software 1 11-16-2003 09:53 AM
Web Server Email Problem peterfig Linux - General 1 01-22-2002 02:09 PM

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

All times are GMT -5. The time now is 06:46 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