From owner-svn-src-all@FreeBSD.ORG Tue Jun 30 13:38:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EAF9106564A; Tue, 30 Jun 2009 13:38:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D1A48FC1A; Tue, 30 Jun 2009 13:38:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5UDcors082158; Tue, 30 Jun 2009 13:38:50 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5UDcoSb082155; Tue, 30 Jun 2009 13:38:50 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <200906301338.n5UDcoSb082155@svn.freebsd.org> From: Ed Maste Date: Tue, 30 Jun 2009 13:38:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195191 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2009 13:38:50 -0000 Author: emaste Date: Tue Jun 30 13:38:49 2009 New Revision: 195191 URL: http://svn.freebsd.org/changeset/base/195191 Log: Add FIONSPACE from NetBSD. FIONSPACE is provided so that programs may easily determine how much space is left in the send queue; they do not need to know the send queue size. NetBSD revisions: sys_socket.c r1.41, 1.42 filio.h r1.9 Obtained from: NetBSD Approved by: re (kensmith) Modified: head/sys/kern/sys_socket.c head/sys/sys/filio.h Modified: head/sys/kern/sys_socket.c ============================================================================== --- head/sys/kern/sys_socket.c Tue Jun 30 13:38:14 2009 (r195190) +++ head/sys/kern/sys_socket.c Tue Jun 30 13:38:49 2009 (r195191) @@ -174,6 +174,14 @@ soo_ioctl(struct file *fp, u_long cmd, v *(int *)data = so->so_snd.sb_cc; break; + case FIONSPACE: + if ((so->so_snd.sb_hiwat < so->so_snd.sb_cc) || + (so->so_snd.sb_mbmax < so->so_snd.sb_mbcnt)) + *(int *)data = 0; + else + *(int *)data = sbspace(&so->so_snd); + break; + case FIOSETOWN: error = fsetown(*(int *)data, &so->so_sigio); break; Modified: head/sys/sys/filio.h ============================================================================== --- head/sys/sys/filio.h Tue Jun 30 13:38:14 2009 (r195190) +++ head/sys/sys/filio.h Tue Jun 30 13:38:49 2009 (r195191) @@ -56,6 +56,7 @@ struct fiodgname_arg { }; #define FIODGNAME _IOW('f', 120, struct fiodgname_arg) /* get dev. name */ #define FIONWRITE _IOR('f', 119, int) /* get # bytes (yet) to write */ +#define FIONSPACE _IOR('f', 118, int) /* get space in send queue */ /* Handle lseek SEEK_DATA and SEEK_HOLE for holey file knowledge. */ #define FIOSEEKDATA _IOWR('f', 97, off_t) /* SEEK_DATA */ #define FIOSEEKHOLE _IOWR('f', 98, off_t) /* SEEK_HOLE */