![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| sed h and g options | sivasenthil_k | Shell Programming and Scripting | 9 | 01-04-2006 06:21 AM |
| Socket Programming socket | soshell | High Level Programming | 2 | 06-29-2004 04:49 AM |
| cat and wc options | Laura01 | Shell Programming and Scripting | 1 | 09-08-2002 08:21 PM |
| socket options | hufs375 | IP Networking | 1 | 05-09-2002 10:02 AM |
| cp options | milage | UNIX for Dummies Questions & Answers | 3 | 07-12-2001 09:20 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
socket problems with cc compile options???
Hi there, a newbie as far as compiling c.
I have a problem, I've ported a fairly simple perl socket program over to c. I compiled it as follows cc simplesocket.c -lsocket -lnsl compiles great, no errors. When I launch it from the command line, it works great!!!! However, if I launch this program from within another socket program ( a perl socket server (listener) program, basically doing an exec of this compiled program ). The server program has no problems launching any other kinds of socket apps. Is there some option I need to tell the compiler that will tell the program it will be running beneath another socket program???? Once again a newbie, any help appreciated. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
how you are doing exec(). Could post the exec code.
|
|
#3
|
|||
|
|||
|
socket problems with cc compile options???
There's really not much to the exec. ( actually it's backtick )
It's perl, so it looks like this, ( not that it looks much different ) $rc = `$path/simplesocket.bin >>/tmp/logging.txt 2>&1`; Note, the launching program does not core or abend, it's just the socket program itself. |
|
#4
|
|||
|
|||
|
Could you post both sokcet program code and perl code. So that we can have look at that. By the information till now, no guesses about the problem.
|
|
#5
|
|||
|
|||
|
I don't think the code is to blame here.
I'm wondering if there is some compiler option that I'm not setting properly. Remember the client code works fine. I can execute it manually from the command line. I can stick it into a shell script and execute it fine from there too. I can run it from a program and it works great. I can run is a differnt user, no problem. The server code works fine too. No problems with 400K launches per month, for the last 10 years. It has no problems launching other binaries or shell or perl scripts. Is there some option that "helps" compile a socket program that must run withing a socket program? Like maybe I need to include some libraries on the compile line or some flags telling it "remember you have to live with some other sockets here" |
|
#6
|
|||
|
|||
|
To compile socket programs, we don't any special options. You may try to build a simple C progam which need some other library (apart from stanard library, may use math library). Then try to execute this using your perl program.
Try to provide -static option with cc. |
|||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|