comp.unix.programmer
  Home FAQ Contact Sign in
comp.unix.programmer only
 
Advanced search
July 2008
motuwethfrsasuw
 123456 27
78910111213 28
14151617181920 29
21222324252627 30
28293031    31
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
comp.unix.programmer Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  AF_UNIX connect()/bind()/listen() race         


Author: Dan Colascione
Date: Jul 22, 2008 11:45

Say we have a short-lived program, C. Its job is to see whether
another program, D, is running, if so, connect to it. Otherwise,
launch the program, then connect to it.

D's standard input is a unix domain socket that's listening for
connections. (See FastCGI). The idea I had for C was to try to
connect() to a specially named socket. Normally, the connect will
succeed and C will do its thing with D.

However, if C gets ECONNREFUSED, D has died, and C unlink()s the
socket. If C gets ENOENT, D hasn't been launched yet. Either way, C
then tries to bind to the socket, fork, launch D, then connect again.
C just complains and exits if this second connect fails.

Now imagine we run two instances of C, C1 and C2, and the socket
doesn't exist when C1 starts.

C1 calls connect(), gets ENOENT, and then tries to bind() the socket.
After the socket is bound, C1 calls listen() to allow the socket to
accept connections.
Show full article (2.54Kb)
1 Comment
  Excellent job Opportunity For Network Testing Professionals..........!!!!!!!!!!         


Author: Mahin
Date: Jul 22, 2008 03:46

Hi Folks,

Greetings To U......

Great Job Opportunities for Network Testing Professionals for Various
CMM level 5 Company.............

Required Skills: (WLAN) or (Network protocol Testing)
Relevant Exp: 2+ year
Job location: All over India

Interested Candidates please revert back with your updated profiles
with following details

CTC:
ECTC:
NP:
Current Location:
Preferred Location:

Tayyaba Athar
jobsindia@bodeninc.com
no comments
  gdb vs fortran RTL -- fight for SIGSEGV         


Author: Jacek Dziedzic
Date: Jul 22, 2008 01:52

Hi!

I have to (unfortunately) debug a FORTRAN-77 program
written by somebody else. The program crashes with a
SIGSEGV, but I can't point the gdb debugger to a line
in code, because SIGSEGV is trapped by the Fortran
Runtime Library, so that it can display a stack trace
and do some cleanup.

What is the way out of this? I tried to turn off this
"feature" during compilation, but to no avail. I tried
forcing gdb to catch the signal, but:
(gdb) catch signal
Catch of signal not yet implemented

How would you go about isolating the problem? The compiler
is Intel's ifort, but I guess I could switch to g77 for
debugging if it helps.

TIA,
- J/
1 Comment
  Duplicate symbols across shared libraries         


Author: Brian Cole
Date: Jul 21, 2008 18:59

I have two libraries, A and B. B includes A.h which has a Meyers
singleton implementation like the following:
class ClassA
{
protected:
static const ClassA &GetInstance()
{
static ClassA singleton;
return singleton;
}
};

I then compile the libraries with the following commands:
g++ -fPIC -c A.cpp
g++ -shared -o libA.so A.o
g++ -fPIC -c B.cpp
g++ -shared -o libB.so B.o -L. -lA
Show full article (2.13Kb)
2 Comments
  Problem with read(2) and pseudo-terminals         


Author: Edd
Date: Jul 21, 2008 13:52

Hello,

The included code fails on Linux but not on OS X. I'm struggling to
understand why. I get:

line 60, errno != EAGAIN && errno != EINTR: Input/output error
(errno = 5)
Aborted

An errno value of 5 is EIO on my Linux installation. It appears to
fail the 2nd time it hits that line.

If I use a pipe instead of a pseudo-terminal (a small change in
make_pt), it also seems to work fine.

Here's the code (also uploaded to http://www.mr-edd.co.uk/files/guff/invoke.c).
It aims to run the program specified by argv[1], ... , argv[argc-1]
and print the output.

#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE 600
#endif
Show full article (3.94Kb)
2 Comments
  Quick (hopefully) question regarding dlopen         


Author: S James S Stapleton
Date: Jul 21, 2008 10:25

I have a library I compiled (ctypeless -> libctypeless.a libctypeless.so),
and have copied the .so and .a files over to /usr/lib

I use dlopen to open the library:
void *dlhandle = dlopen(libfile, RTLD_NOW | RTLD_GLOBAL);

with libfile as "ctypeless", "libctypeless.so", "/usr/lib/libctypeless.so"

and in all of the cases, the library will not open. dlhandle points to 0x0
dlerror() returns: "Invalid shared object handle"

Any suggestions on what I'm doing wrong? The system in question is FreeBSD
7.0 with the default GCC (4.2.1)

Thanks,
-Jim Stapleton
6 Comments
  cheap air jordan 22 PayPal         


Author: yuwenwu010
Date: Jul 21, 2008 10:03

cheap air jordan 22 PayPal
welcome to shopping on www.Shoes-paypal.cn
1.5%% paypal handling charge supports the online payment!
2.Use your intergla replacement more good gift!
3.notes by email and website of deliver each package at first time.

Have a good day!
Sincerely yours,
CHINASILKROAD EXPORTS CO., LTD
no comments
  ioctl SIOCGSTAMP and sent packets..         


Author: frakie
Date: Jul 21, 2008 08:27

Hi 'body,
does somebody know if there is something like ioctl SIOCGSTAMP
mechanism to get timestamps for sent packets?
no comments
  Is Message passing good approach for multi-threaded applications?         


Author: Behzad
Date: Jul 21, 2008 05:54

hi all,

I am currently developing an embedded protocol converter.In this
application there are 16 serial ports and 2 Ethernet ports.There are
16 threads for each serial port and also there is a network server...
Show full article (0.99Kb)
6 Comments
  SO_DEBUG in UDP socket         


Author: lak
Date: Jul 20, 2008 23:26

I have a doubt in the SO_DEBUG. According to the Unix network
programming Networking API sockets volume 1 by richard stevans p.no
184, tells that SO_DEBUG will be used only in TCP.

My question is then what is the use of -d option in the traceroute
which is using the UDP datagrams?

The -d option will enable the SO_DEBUG.

Please clarify me
no comments
 
1 2 3 4 5 6 7 8 9