Date: Tue, 30 Oct 2001 22:20:01 -0800 (PST) From: Edwin Groothuis <edwin@mavetju.org> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/31649: libpcap doesn't work with -pthread Message-ID: <200110310620.f9V6K1V85565@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/31649; it has been noted by GNATS.
From: Edwin Groothuis <edwin@mavetju.org>
To: freebsd-gnats-submit@FreeBSD.org
Cc:
Subject: Re: bin/31649: libpcap doesn't work with -pthread
Date: Wed, 31 Oct 2001 17:17:11 +1100
Some minor further investigations in libpcap showed that the read()
function in /usr/src/contrib/libpcap/pcap-bpf.c:81 looks like it's
blocking until the buffer is fully filled:
if (p->cc == 0) {
+ fprintf(stderr,"pcap_read before read (bufsize: %d bytes)\n",p->bufsize);
cc = read(p->fd, (char *)p->buffer, p->bufsize);
+ fprintf(stderr,"pcap_read after read (read: %d bytes)\n",cc);
if (cc < 0) {
This is the effect on a version without -pthread:
[~/bpf] edwin@friet44>./nw_u
pcap_read entered
pcap_read before read (bufsize: 32768 bytes)
pcap_read after read (read: 244 bytes)
..pcap_read entered
pcap_read before read (bufsize: 32768 bytes)
pcap_read after read (read: 276 bytes)
..pcap_read entered
This is the effect on a version with -pthread:
[~/bpf] edwin@friet44>./nw
pcap_read entered
pcap_read before read bufsize: (32768 bytes)
pcap_read after read (read: 32232 bytes)
...........................................................pcap_read entered
pcap_read before read (bufsize: 32768 bytes)
pcap_read after read (read: 32160 bytes)
.........................................................pcap_read entered
pcap_read before read (bufsize: 32768 bytes)
pcap_read after read (read: 31648 bytes)
I have no idea how to solve this...
Edwin
--
Edwin Groothuis | Personal website: http://www.MavEtJu.org
edwin@mavetju.org | Interested in MUDs? Visit Fatal Dimensions:
------------------+ http://www.FatalDimensions.org/
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200110310620.f9V6K1V85565>
