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.

how you are doing exec(). Could post the exec code.

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.

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.

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"

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.