Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 Jul 2015 17:28:12 +1000 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        John-Mark Gurney <jmg@funkthat.com>
Cc:        Bruce Evans <brde@optusnet.com.au>, src-committers@freebsd.org,  svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r286103 - head/share/man/man9
Message-ID:  <20150731171611.O2162@besplex.bde.org>
In-Reply-To: <20150731070314.GY78154@funkthat.com>
References:  <201507310328.t6V3S3LC087650@repo.freebsd.org> <20150731152253.Y1843@besplex.bde.org> <20150731070314.GY78154@funkthat.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 31 Jul 2015, John-Mark Gurney wrote:

> Bruce Evans wrote this message on Fri, Jul 31, 2015 at 16:21 +1000:
>> On Fri, 31 Jul 2015, John-Mark Gurney wrote:
>>
>>> Log:
>>>  The implementation note isn't true anymore..
>>>
>>>  Not that anyone reads it, but those that do, remind them that this
>>>  isn't usable in userland...  I can't wait till this doc is wrong..
>>
>> It goes without saying that an API documented in a section 9 man page
>> isn't usable in userland
>
> I think you mean that some API's are well documented in section 9
> and undocumented in section 3.  For example, atomic(9) is used in
> userland in such places as libthr, jemalloc, and more.

Bug in these places.  It is now clear that they should use C11 atomics.
Both are very hard to understand even with documentation.  The C11 ones
are more complicate and the FreeBSD ones are more subject to change.

>> In this case, it is obviously even more unusable in userland, because
>> the documentation specifies including <sys/systm.h>.  That header is
>> undocumented, but everyone should know that it it is kernel-only.
>
> Well, now I know.. it'd be nice to document it w/ an
> ifndef _KERNEL/error line..  or at least a comment... or even in
> the documentation...

It should have had #error if !_KERNEL but it is apparently unusable
without _KERNEL anyway.

Applications can now use _Static_assert(condition, message) instead
of rthe FreeBSDism CTASSERT().  _Static_assert() is in <sys/cdefs.h>
so it is available everywhere.  Of course, it is undocumented like
most things there, and it goes without saying that using it is a misuse
since it is in the implementation namespace :-).  It seems to be
standard only in C++, with the spelling static_assert().

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150731171611.O2162>