From owner-freebsd-bugs Tue Oct 30 22:20: 8 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 8F91B37B403 for ; Tue, 30 Oct 2001 22:20:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f9V6K1V85565; Tue, 30 Oct 2001 22:20:01 -0800 (PST) (envelope-from gnats) Date: Tue, 30 Oct 2001 22:20:01 -0800 (PST) Message-Id: <200110310620.f9V6K1V85565@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Edwin Groothuis Subject: Re: bin/31649: libpcap doesn't work with -pthread Reply-To: Edwin Groothuis Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/31649; it has been noted by GNATS. From: Edwin Groothuis 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