NetBSD-Users archive

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

Re: getconf LONG_BIT in NetBSD



The `limits.h` header file in C provides the necessary information about system limits, including `LONG_BIT`. You can write a small C program to print the value of `LONG_BIT`.

Create a simple C program that includes the `limits.h` header and prints the value of `LONG_BIT`.


#include <stdio.h>
#include <limits.h>

int main() {
    printf("LONG_BIT: %d\n", LONG_BIT);
    return 0;
}

This will output the number of bits in a "long" integer on your system.



On Mon, 20 May, 2024, 1:38 am Ramiro Aceves, <ea1abz%gmail.com@localhost> wrote:
Hello,

I have been playing with an autoconf ./configure script that I want get
running in several OSes. The script uses "getconf LONG_BIT" to get the
bits of the system.


I see that "getconfg LONG_BIT" works in other systems such as  Linux and
FreeBSD but in NetBSD I have tried it and it does not work:

netbsd-nuc$ getconf LONG_BIT
getconf: LONG_BIT: unknown variable


I read this on limits (3) man page about LONG_BIT:


    XSI Limits
      Also the X/Open System Interface Extension (XSI) specifies few
limits. In NetBSD these are limited to LONG_BIT (the number of bits in
long), WORD_BIT (the number of bits in a “word”), and few limits related
to float and double.

How can I get the value of the LONG_BIT variable?

Thanks you very much.
Regards.



Home | Main Index | Thread Index | Old Index