From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 8 13:08:51 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CCC10106566C; Sun, 8 Apr 2012 13:08:51 +0000 (UTC) (envelope-from nec556@retena.com) Received: from resmaa12.ono.com (smtp12.ono.com [62.42.230.20]) by mx1.freebsd.org (Postfix) with ESMTP id 638B78FC1B; Sun, 8 Apr 2012 13:08:50 +0000 (UTC) Received: from GogPortatil.retena.com (37.11.170.63) by resmaa12.ono.com (8.5.113) (authenticated as nec556@retena.com) id 4EFDA3B5017E0D89; Sun, 8 Apr 2012 15:08:49 +0200 Message-ID: <4EFDA3B5017E0D89@> (added by postmaster@resmaa12.ono.com) X-Mailer: QUALCOMM Windows Eudora Version 7.1.0.9 Date: Sun, 08 Apr 2012 15:10:17 +0200 To: Ivan Voras From: Eduardo Morras In-Reply-To: References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Antivirus: AVG for E-mail 2012.0.1913 [2411/4921] Cc: freebsd-hackers@freebsd.org Subject: Re: Socket buffer usage X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2012 13:08:51 -0000 At 23:16 07/04/2012, you wrote: >Hi, > >I'm tracking down an obscure bug in my userland program and it might >have something to do with the way I write&read data through a (Unix >domain) socket. I'm setting SO_SNDBUF and SO_RCVBUF, and what I'm >looking for is some way to query the amount of TX & RX buffered / free >data on a socket. Is there something I can use? I'll even accept >inspecting kernel structures if explained in detail and can be done on >a running system. > >Alternatively, is there anything else which could cause poll(2) with >POLLOUT on a socket to return no events ready on such a socket? (my >expectation being that a socket is always ready to be written to if >there is buffer space free...). Setting fd to -1 in pollfd struct resets revents. Perhaps you have not setted fd properly. >_______________________________________________ >freebsd-hackers@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-hackers >To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"