From owner-freebsd-questions@FreeBSD.ORG Wed Nov 18 20:03:17 2009 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C5F61065780 for ; Wed, 18 Nov 2009 20:03:17 +0000 (UTC) (envelope-from ryans@rpsommers.com) Received: from mail-bw0-f213.google.com (mail-bw0-f213.google.com [209.85.218.213]) by mx1.freebsd.org (Postfix) with ESMTP id 20E228FC21 for ; Wed, 18 Nov 2009 20:03:16 +0000 (UTC) Received: by bwz5 with SMTP id 5so1735706bwz.3 for ; Wed, 18 Nov 2009 12:03:15 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.86.206 with SMTP id w56mr2379399wee.1.1258572692989; Wed, 18 Nov 2009 11:31:32 -0800 (PST) Date: Wed, 18 Nov 2009 13:31:32 -0600 Message-ID: <3752c73e0911181131yea7b1s499776e045dc684d@mail.gmail.com> From: Ryan Sommers To: questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: Subject: RecvQ Size from fd? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Nov 2009 20:03:17 -0000 Is it possible to get the amount of data in the receive queue from a socket file descriptor (userland app)? I see that netstat gets a list of struct socket* and from there you can find the answer from the so_rcv sockbuf. But I can't find a way to match a socket fd up to the struct sock. Thanks, Ryan -- Ryan P Sommers ryans@rpsommers.com