Date: Thu, 17 Mar 2016 08:19:50 +0100 From: Hans Petter Selasky <hps@selasky.org> To: Gleb Smirnoff <glebius@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296933 - in head: share/man/man9 sys/sys Message-ID: <56EA5A96.5070402@selasky.org> In-Reply-To: <20160316203601.GO1328@FreeBSD.org> References: <201603160837.u2G8bqgr087126@repo.freebsd.org> <20160316203601.GO1328@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 03/16/16 21:36, Gleb Smirnoff wrote: > On Wed, Mar 16, 2016 at 08:37:52AM +0000, Hans Petter Selasky wrote: > H> Modified: head/sys/sys/sysctl.h > H> ============================================================================== > H> --- head/sys/sys/sysctl.h Wed Mar 16 06:42:15 2016 (r296932) > H> +++ head/sys/sys/sysctl.h Wed Mar 16 08:37:52 2016 (r296933) > H> @@ -654,8 +654,10 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e > H> SYSCTL_OID(parent, nbr, name, \ > H> CTLTYPE_OPAQUE | CTLFLAG_MPSAFE | (access), \ > H> (ptr), (len), sysctl_handle_counter_u64_array, "S", descr); \ > H> - CTASSERT(((access) & CTLTYPE) == 0 || \ > H> - ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE) > H> + CTASSERT((((access) & CTLTYPE) == 0 || \ > H> + ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE) && \ > H> + sizeof(counter_u64_t) == sizeof(*(ptr)) && \ > H> + sizeof(uint64_t) == sizeof(**(ptr))) > > I don't agree with the last line. Does it assert that counter_u64_t is > implemented using uint64_t? That is true, but that is internal detail, > that might be changed in future. > Yes, it asserts that counter_u64_t is a 64-bit counter, as the name of the typedef hints at. From the past experience there has been several cases where someone has changed a field in structure which is exported as a sysctl, and then the sysctls were never updated. --HPS
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?56EA5A96.5070402>