Print this page
452 /usr/@(|xpg4/|xpg6/)bin/getconf need to support NPROCESSORS_*
Reviewed by: Garrett D'Amore <garrett@damore.org>


 730          * Due to an ambiguity in the specification, we need to recognize both
 731          * the underscored POSIX name and the non-underscored name. In addition,
 732          * we need to permit the use of the _V6_* environment names specified
 733          * in unistd.h.
 734          */
 735         _SC_V6_ILP32_OFF32,     "_V6_ILP32_OFF32",      SYSCONF,        NOFLAGS,
 736         _SC_V6_ILP32_OFF32,     "_POSIX_V6_ILP32_OFF32", SYSCONF,       NOFLAGS,
 737         _SC_V6_ILP32_OFF32,     "POSIX_V6_ILP32_OFF32", SYSCONF,        NOFLAGS,
 738 
 739         _SC_V6_ILP32_OFFBIG,    "_V6_ILP32_OFFBIG",     SYSCONF,        NOFLAGS,
 740         _SC_V6_ILP32_OFFBIG,    "_POSIX_V6_ILP32_OFFBIG", SYSCONF,      NOFLAGS,
 741         _SC_V6_ILP32_OFFBIG,    "POSIX_V6_ILP32_OFFBIG", SYSCONF,       NOFLAGS,
 742 
 743         _SC_V6_LP64_OFF64,      "_V6_LP64_OFF64",       SYSCONF,        NOFLAGS,
 744         _SC_V6_LP64_OFF64,      "_POSIX_V6_LP64_OFF64", SYSCONF,        NOFLAGS,
 745         _SC_V6_LP64_OFF64,      "POSIX_V6_LP64_OFF64",  SYSCONF,        NOFLAGS,
 746 
 747         _SC_V6_LPBIG_OFFBIG,    "_V6_LPBIG_OFFBIG",     SYSCONF,        NOFLAGS,
 748         _SC_V6_LPBIG_OFFBIG,    "_POSIX_V6_LPBIG_OFFBIG", SYSCONF,      NOFLAGS,
 749         _SC_V6_LPBIG_OFFBIG,    "POSIX_V6_LPBIG_OFFBIG",  SYSCONF,      NOFLAGS,






 750         0,              NULL,   0,      0               /* end of table */
 751 };
 752 
 753 
 754 /*
 755  * Print usage message.
 756  */
 757 static int
 758 usage()
 759 {
 760 
 761         (void) fputs(gettext(
 762             "usage:\tgetconf [-v specification] system_var\n"
 763             "\tgetconf [-v specification] path_var pathname\n"
 764             "\tgetconf -a\n"), stderr);
 765         return (2);
 766 }
 767 
 768 
 769 static int




 730          * Due to an ambiguity in the specification, we need to recognize both
 731          * the underscored POSIX name and the non-underscored name. In addition,
 732          * we need to permit the use of the _V6_* environment names specified
 733          * in unistd.h.
 734          */
 735         _SC_V6_ILP32_OFF32,     "_V6_ILP32_OFF32",      SYSCONF,        NOFLAGS,
 736         _SC_V6_ILP32_OFF32,     "_POSIX_V6_ILP32_OFF32", SYSCONF,       NOFLAGS,
 737         _SC_V6_ILP32_OFF32,     "POSIX_V6_ILP32_OFF32", SYSCONF,        NOFLAGS,
 738 
 739         _SC_V6_ILP32_OFFBIG,    "_V6_ILP32_OFFBIG",     SYSCONF,        NOFLAGS,
 740         _SC_V6_ILP32_OFFBIG,    "_POSIX_V6_ILP32_OFFBIG", SYSCONF,      NOFLAGS,
 741         _SC_V6_ILP32_OFFBIG,    "POSIX_V6_ILP32_OFFBIG", SYSCONF,       NOFLAGS,
 742 
 743         _SC_V6_LP64_OFF64,      "_V6_LP64_OFF64",       SYSCONF,        NOFLAGS,
 744         _SC_V6_LP64_OFF64,      "_POSIX_V6_LP64_OFF64", SYSCONF,        NOFLAGS,
 745         _SC_V6_LP64_OFF64,      "POSIX_V6_LP64_OFF64",  SYSCONF,        NOFLAGS,
 746 
 747         _SC_V6_LPBIG_OFFBIG,    "_V6_LPBIG_OFFBIG",     SYSCONF,        NOFLAGS,
 748         _SC_V6_LPBIG_OFFBIG,    "_POSIX_V6_LPBIG_OFFBIG", SYSCONF,      NOFLAGS,
 749         _SC_V6_LPBIG_OFFBIG,    "POSIX_V6_LPBIG_OFFBIG",  SYSCONF,      NOFLAGS,
 750 /*
 751  * System V Interface Definition
 752  */
 753         _SC_NPROCESSORS_CONF,   "NPROCESSORS_CONF",     SYSCONF,        NOFLAGS,
 754         _SC_NPROCESSORS_MAX,    "NPROCESSORS_MAX",      SYSCONF,        NOFLAGS,
 755         _SC_NPROCESSORS_ONLN,   "NPROCESSORS_ONLN",     SYSCONF,        NOFLAGS,
 756         0,              NULL,   0,      0               /* end of table */
 757 };
 758 
 759 
 760 /*
 761  * Print usage message.
 762  */
 763 static int
 764 usage()
 765 {
 766 
 767         (void) fputs(gettext(
 768             "usage:\tgetconf [-v specification] system_var\n"
 769             "\tgetconf [-v specification] path_var pathname\n"
 770             "\tgetconf -a\n"), stderr);
 771         return (2);
 772 }
 773 
 774 
 775 static int