From 42aee7688f31eaf5c0bbbb9feb417b98fa807551 Mon Sep 17 00:00:00 2001 From: wollman Date: Sun, 27 Oct 2002 04:10:34 +0000 Subject: [PATCH] Add new 1003.1-2001/TC1/D6 parameters. (On final recirculation ballot now, so this should be officially TC1 before the New Year.) Add TrustedBSD pathconf parameters. Add compilation support for -stable (to be merged momentarily). --- usr.bin/getconf/getconf.c | 2 +- usr.bin/getconf/getconf.h | 8 +++++++- usr.bin/getconf/pathconf.gperf | 6 ++++++ usr.bin/getconf/sysconf.gperf | 2 ++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/usr.bin/getconf/getconf.c b/usr.bin/getconf/getconf.c index 1e991b6ab372..8bfeb93c4713 100644 --- a/usr.bin/getconf/getconf.c +++ b/usr.bin/getconf/getconf.c @@ -98,7 +98,7 @@ main(int argc, char **argv) if (argv[optind + 1] == NULL) { /* confstr or sysconf */ if ((valid = find_limit(name, &limitval)) != 0) { if (valid > 0) - printf("%jd\n", limitval); + printf("%" PRIdMAX "\n", limitval); else printf("undefined\n"); diff --git a/usr.bin/getconf/getconf.h b/usr.bin/getconf/getconf.h index 60d10d24f678..aab06a6eb6ee 100644 --- a/usr.bin/getconf/getconf.h +++ b/usr.bin/getconf/getconf.h @@ -29,7 +29,13 @@ * $FreeBSD$ */ -#include +#ifdef STABLE +typedef long long intmax_t; +#define strtoimax(p, ep, radix) (strtoll((p), (ep), (radix))) +#define PRIdMAX "lld" +#else +#include +#endif int find_confstr(const char *name, int *key); int find_limit(const char *name, intmax_t *value); diff --git a/usr.bin/getconf/pathconf.gperf b/usr.bin/getconf/pathconf.gperf index b44e824349fc..60c05d45580d 100644 --- a/usr.bin/getconf/pathconf.gperf +++ b/usr.bin/getconf/pathconf.gperf @@ -33,6 +33,12 @@ POSIX_REC_INCR_XFER_SIZE, _PC_REC_INCR_XFER_SIZE POSIX_REC_MAX_XFER_SIZE, _PC_REC_MAX_XFER_SIZE POSIX_REC_MIN_XFER_SIZE, _PC_REC_MIN_XFER_SIZE POSIX_REC_XFER_ALIGN, _PC_REC_XFER_ALIGN +SYMLINK_MAX, _PC_SYMLINK_MAX +TRUSTEDBSD_ACL_EXTENDED, _PC_ACL_EXTENDED +TRUSTEDBSD_ACL_PATH_MAX, _PC_ACL_PATH_MAX +TRUSTEDBSD_CAP_PRESENT, _PC_CAP_PRESENT +TRUSTEDBSD_INF_PRESENT, _PC_INF_PRESENT +TRUSTEDBSD_MAC_PRESENT, _PC_MAC_PRESENT _POSIX_CHOWN_RESTRICTED, _PC_CHOWN_RESTRICTED _POSIX_NO_TRUNC, _PC_NO_TRUNC _POSIX_VDISABLE, _PC_VDISABLE diff --git a/usr.bin/getconf/sysconf.gperf b/usr.bin/getconf/sysconf.gperf index 5467d1135a4e..1c9d2bc28045 100644 --- a/usr.bin/getconf/sysconf.gperf +++ b/usr.bin/getconf/sysconf.gperf @@ -60,6 +60,7 @@ SEM_NSEMS_MAX, _SC_SEM_NSEMS_MAX SEM_VALUE_MAX, _SC_SEM_VALUE_MAX SIGQUEUE_MAX, _SC_SIGQUEUE_MAX STREAM_MAX, _SC_STREAM_MAX +SYMLOOP_MAX, _SC_SYMLOOP_MAX TIMER_MAX, _SC_TIMER_MAX TTY_NAME_MAX, _SC_TTY_NAME_MAX TZNAME_MAX, _SC_TZNAME_MAX @@ -79,6 +80,7 @@ _POSIX_CLOCK_SELECTION, _SC_CLOCK_SELECTION _POSIX_CPUTIME, _SC_CPUTIME _POSIX_FILE_LOCKING, _SC_FILE_LOCKING _POSIX_FSYNC, _SC_FSYNC +_POSIX_IPV6, _SC_IPV6 _POSIX_JOB_CONTROL, _SC_JOB_CONTROL _POSIX_MAPPED_FILES, _SC_MAPPED_FILES _POSIX_MEMLOCK, _SC_MEMLOCK