Jeff Abrahamson on 22 Feb 2004 18:41:02 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] UDP programming question


On Sun, Feb 22, 2004 at 01:00:15PM -0500, gabriel rosenkoetter wrote:
> > In a follow-on mail, I noted that not compiling with threads solved
> > the problem.  I don't understand at all why that should matter: I
> > wasn't using threads, just planning to later.
> 
> At a guess, is your threads library (brokenly) wrapping recvfrom(2)?

That seems a good guess, but I don't know.

  jeff@asterix:jeff $ pkg-config --cflags --libs gthread-2.0
  -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include  -pthread -lgthread-2.0 -lglib-2.0
  jeff@asterix:jeff $


Hmm...

  jeff@asterix:lib $ cd /usr/lib
  jeff@asterix:lib $ nm libpthread.a|grep recvfrom
  ptw-recvfrom.o:
  00000000 T __libc_recvfrom
  00000000 W recvfrom
  00000000 W __recvfrom
  jeff@asterix:lib $ nm libgthread-2.0.a | grep recvfrom
  jeff@asterix:lib $ nm libglib-2.0.a | grep recvfrom
  jeff@asterix:lib $

I think that means that pthread defines recvfrom weakly, which means
that if it's supplied elsewhere the alternate definition is used.  But
I admit I'm a bit unclear on how to do the same query on the shared
libraries that my test program actually links against.

Fwiw, my test file is at

    http://www.purple.com/udp.tgz

-- 
 Jeff

 Jeff Abrahamson  <http://www.purple.com/jeff/>
 GPG fingerprint: 1A1A BA95 D082 A558 A276  63C6 16BF 8C4C 0D1D AE4B

Attachment: signature.asc
Description: Digital signature