From owner-freebsd-arch@FreeBSD.ORG Tue Dec 17 08:23:34 2013 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B656C962; Tue, 17 Dec 2013 08:23:34 +0000 (UTC) Received: from mail-qe0-x229.google.com (mail-qe0-x229.google.com [IPv6:2607:f8b0:400d:c02::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 66F4B18FA; Tue, 17 Dec 2013 08:23:34 +0000 (UTC) Received: by mail-qe0-f41.google.com with SMTP id gh4so4859463qeb.14 for ; Tue, 17 Dec 2013 00:23:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=CpdHcgt3/vfcq5vPH59CcIp4GrAxWj/zMxKrTEgrgSs=; b=l8KwS8n3ZsKA0qr0ZxwRw8j40kV8fpkk8w5BGeo8UkhKI+brvM97Xe8rAkDCFCGGWV EH+ZUz29AHHCI79sqJ28yq4+p2ooH8hABeYuzwid/WTA5dBBjegKphj8ZnnYvuQP/lk9 gCeWXkD/trMnPeRtcg2yUNHvV06u0peXYLhLtkQrmhvk6IieuoFysPE2U03zJvmdw9q6 6UdZSDghuEqilKZjFNJPXyQEaVurhsQ/3Hl/9UgcfeYujFleBv3iVH0+s0iCMZlcB/Ci W8EMERVLpTl+BkgPKPGou3Mlg5Wqu5GQYbrEP0pNxuiOzrIN9nzqYL/Kyze/LKmJCQiS JJzg== MIME-Version: 1.0 X-Received: by 10.49.129.38 with SMTP id nt6mr40693631qeb.78.1387268613552; Tue, 17 Dec 2013 00:23:33 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.53.200 with HTTP; Tue, 17 Dec 2013 00:23:33 -0800 (PST) Date: Tue, 17 Dec 2013 00:23:33 -0800 X-Google-Sender-Auth: gDh6qC9w8pGz5BEh0d5wjQfvi1o Message-ID: Subject: Using sys/types.h types in sys/socket.h From: Adrian Chadd To: "freebsd-arch@freebsd.org" , Bruce Evans Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 08:23:34 -0000 Hi, I have a patch to implement some new sendfile functionality, but this involves adding stuff to sys/socket.h: Index: sys/sys/socket.h =================================================================== --- sys/sys/socket.h (revision 258883) +++ sys/sys/socket.h (working copy) @@ -577,11 +577,27 @@ }; /* + * sendfile(2) kqueue information + */ +struct sf_hdtr_kq { + int kq_fd; /* kq fd to post completion events on */ + uint32_t kq_flags; /* extra flags to pass in */ + void *kq_udata; /* user data pointer */ + uintptr_t kq_ident; /* ident (from userland?) */ +}; + +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 ... now, uintptr_t upsets things, because we don't include sys/types.h before sys/socket.h. The POSIX spec for sys/socket.h doesn't mention a dependency on sys/types.h and in fact says it should define a couple of types itself. http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_socket.h.html .. so, what suggestions do people have? I'd like to do this right and not cause header pollution. Thanks! -a