From owner-freebsd-arch@FreeBSD.ORG Wed Jan 8 22:29:39 2014 Return-Path: Delivered-To: freebsd-arch@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 461A3F6C; Wed, 8 Jan 2014 22:29:39 +0000 (UTC) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 007F1182B; Wed, 8 Jan 2014 22:29:38 +0000 (UTC) Received: from c122-106-144-87.carlnfd1.nsw.optusnet.com.au (c122-106-144-87.carlnfd1.nsw.optusnet.com.au [122.106.144.87]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id EBDEA422FC4; Thu, 9 Jan 2014 09:29:27 +1100 (EST) Date: Thu, 9 Jan 2014 09:29:26 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Adrian Chadd Subject: Re: Using sys/types.h types in sys/socket.h In-Reply-To: Message-ID: <20140109092602.M957@besplex.bde.org> References: <9C1291B5-215B-440E-B8B0-6308840F755C@bsdimp.com> <5821DA91-E9C7-4D1A-A108-63E74CFF1FC5@bsdimp.com> <20140108152632.L969@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=YYGEuWhf c=1 sm=1 tr=0 a=p/w0leo876FR0WNmYI1KeA==:117 a=PO7r1zJSAAAA:8 a=n4PiHyf99_4A:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=zprIhm_aaxwA:10 a=h6NmhQJtDk7Lkny6k4oA:9 a=CjuIK1q_8ugA:10 Cc: "freebsd-arch@freebsd.org" , Bruce Evans 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: Wed, 08 Jan 2014 22:29:39 -0000 On Wed, 8 Jan 2014, Adrian Chadd wrote: > On 7 January 2014 20:48, Bruce Evans wrote: >> Style(9) specifies sorting by size first (it actually mean by alignment >> first). That is not very easy since the size^Walignment of typedefed >> types should be opaque. In practice, assuming what it is mostly gives >> correct results. It gives exactly the opposite of the above: >> >> N-bit u_int holding ptr >> M-bit pointer /* assume M <= N and alignment == size */ >> 32-bit u_int (can spell it u_int, not uint32_t, to pack better with int) >> 32-bit int /* assume plain int gives this */ > > So: > > /* > * 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 */ > }; > > ? Also fix the indentation (use 1 tab after 'void' and 'int' and not the allowed ugliness of 2 tabs after all type names). Bruce