From owner-svn-src-all@FreeBSD.ORG Fri Jan 17 05:13:09 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 088BC79E; Fri, 17 Jan 2014 05:13:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E971F1E9D; Fri, 17 Jan 2014 05:13:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0H5D8U8092968; Fri, 17 Jan 2014 05:13:08 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0H5D8RH092967; Fri, 17 Jan 2014 05:13:08 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201401170513.s0H5D8RH092967@svn.freebsd.org> From: Adrian Chadd Date: Fri, 17 Jan 2014 05:13:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r260804 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 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: Fri, 17 Jan 2014 05:13:09 -0000 Author: adrian Date: Fri Jan 17 05:13:08 2014 New Revision: 260804 URL: http://svnweb.freebsd.org/changeset/base/260804 Log: Implement the extension api for sendfile to allow for kqueue notifications. This is still under a bit of flux, as the final API hasn't been nailed down. It's also unclear whether we should define the two new types in the header or not - it may allow bad code to compile that shouldn't (ie, since uintX's are defined, the developer may not include sys/types.h.) Reviewed by: peter, imp, bde Sponsored by: Netflix, Inc. Modified: head/sys/sys/socket.h Modified: head/sys/sys/socket.h ============================================================================== --- head/sys/sys/socket.h Fri Jan 17 04:38:58 2014 (r260803) +++ head/sys/sys/socket.h Fri Jan 17 05:13:08 2014 (r260804) @@ -84,6 +84,16 @@ typedef __uid_t uid_t; #endif #endif +#ifndef _UINT32_T_DECLARED +typedef __uint32_t uint32_t; +#define _UINT32_T_DECLARED +#endif + +#ifndef _UINTPTR_T_DECLARED +typedef __uintptr_t uintptr_t; +#define _UINTPTR_T_DECLARED +#endif + /* * Types */ @@ -577,11 +587,27 @@ struct sf_hdtr { }; /* + * sendfile(2) kqueue information + */ +struct sf_hdtr_kq { + uintptr_t kq_ident; /* ident (from userland?) */ + void *kq_udata; /* user data pointer */ + uint32_t kq_flags; /* extra flags to pass in */ + int kq_fd; /* kq fd to post completion events on */ +}; + +struct sf_hdtr_all { + struct sf_hdtr hdtr; + struct sf_hdtr_kq kq; +}; + +/* * Sendfile-specific flag(s) */ #define SF_NODISKIO 0x00000001 #define SF_MNOWAIT 0x00000002 #define SF_SYNC 0x00000004 +#define SF_KQUEUE 0x00000008 #ifdef _KERNEL #define SFK_COMPAT 0x00000001