tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: getconf(1) / sysconf(3) - add additional variables?



On Fri, Jul 02, 2021 at 03:39:19PM +0100, Michael-John Turner wrote:
> Indeed, I mean sysconf(3). Sorry for the confusion, I started typing my
> email, did some further investigation and then didn't edit it correctly.

Still doesn't make sense to me - it is a compile time constant, I see
no way to get different results from the kernel.

> > But we could add
> > 
> > #define	LONG_BIT	__LONG_WIDTH
> > 
> > to <limits.h> inside proper #if guards.
> 
> I see OpenBSD defines LONG_BIT as follows:
> 
> #if __XPG_VISIBLE || __POSIX_VISIBLE >= 200809
> # ifdef __LP64__
> #  define LONG_BIT      64
> # else
> #  define LONG_BIT      32
> # endif
> # define WORD_BIT       32
> #endif


The compilers provide proper __LONG_WIDTH (and similar) definitions
already, no point hardwiring them to anything else.

Martin


Home | Main Index | Thread Index | Old Index