This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: Connect system call in SCO


>       think it is the problem with the connect system call itself, when it
> fails.

Since OpenServer doesn't really support threads, the system calls
have no way of knowing if they're threaded or not.  (In fact, this is
one of the major reasons that the various "strap-on" threads packages
for OpenServer can be such a bumpy road; they have to do all sorts of
wrapping themselves.)

>     I am using FSUPthreads, as the thread support on SCO.

I just pulled FSUpthreads 3.5 from ftp.caldera.com/skunkware.

>     The example program which confirmed it is attached.
>       It is a client program. Just make it fail at the connect system call.
> I gave a wrong server IP to
>        make it fail. 
>   Any hints.

You didn't describe what constitutes failure or success or include
sample compilation lines, but I was able to to build and run your
program just fine.

$ gcc   c.cpp -lgthreads -lsocket && ./a.out
INSIDE THE THREAD


Of course, if you get the library link order wrong, you'll get different
results:

$ gcc   c.cpp -lsocket -lgthreads && ./a.out
INSIDE THE THREAD
normal -2146743556
Main : Unknown error
result of connection in loop no 1  ---1--


Are you seeing something else completely?  I'm thinking this isn't a g++
thing at all...

RJL


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