diff --git a/usr.bin/getconf/Makefile b/usr.bin/getconf/Makefile index a5cdc0423a25..edf1a83b5a8e 100644 --- a/usr.bin/getconf/Makefile +++ b/usr.bin/getconf/Makefile @@ -4,11 +4,12 @@ PROG= getconf -SRCS= confstr.c getconf.c limits.c pathconf.c progenv.c sysconf.c +SRCS= confstr.c getconf.c limits.c pathconf.c progenv.c sysconf.c \ + unsigned_limits.c CFLAGS+= -I${.CURDIR} CLEANFILES+= confstr.c limits.c pathconf.c progenv.c sysconf.c \ confstr.names limits.names pathconf.names sysconf.names \ - conflicting.names unique.names + conflicting.names unique.names unsigned_limits.names .SUFFIXES: .gperf .names .PHONY: conflicts diff --git a/usr.bin/getconf/getconf.c b/usr.bin/getconf/getconf.c index 7cbebfe6b183..8edb3c380a4b 100644 --- a/usr.bin/getconf/getconf.c +++ b/usr.bin/getconf/getconf.c @@ -65,6 +65,7 @@ main(int argc, char **argv) int c, key, valid; const char *name, *vflag, *alt_path; intmax_t limitval; + uintmax_t ulimitval; aflag = false; vflag = NULL; @@ -115,6 +116,13 @@ main(int argc, char **argv) } if (argv[optind + 1] == NULL) { /* confstr or sysconf */ + if ((valid = find_unsigned_limit(name, &ulimitval)) != 0) { + if (valid > 0) + printf("%" PRIuMAX "\n", ulimitval); + else + printf("undefined\n"); + return 0; + } if ((valid = find_limit(name, &limitval)) != 0) { if (valid > 0) printf("%" PRIdMAX "\n", limitval); diff --git a/usr.bin/getconf/getconf.h b/usr.bin/getconf/getconf.h index 7629e2bd8116..843b9f0edbfd 100644 --- a/usr.bin/getconf/getconf.h +++ b/usr.bin/getconf/getconf.h @@ -37,6 +37,7 @@ typedef long long intmax_t; #endif int find_confstr(const char *name, int *key); +int find_unsigned_limit(const char *name, uintmax_t *value); int find_limit(const char *name, intmax_t *value); int find_pathconf(const char *name, int *key); int find_progenv(const char *name, const char **alt_path); diff --git a/usr.bin/getconf/limits.gperf b/usr.bin/getconf/limits.gperf index 68e0d65e78ff..4e799d95bf88 100644 --- a/usr.bin/getconf/limits.gperf +++ b/usr.bin/getconf/limits.gperf @@ -86,11 +86,6 @@ SCHAR_MIN, SCHAR_MIN SHRT_MAX, SHRT_MAX SHRT_MIN, SHRT_MIN SSIZE_MAX, SSIZE_MAX -UCHAR_MAX, UCHAR_MAX -UINT_MAX, UINT_MAX -ULLONG_MAX, ULLONG_MAX -ULONG_MAX, ULONG_MAX -USHRT_MAX, USHRT_MAX WORD_BIT, WORD_BIT CHARCLASS_NAME_MAX, CHARCLASS_NAME_MAX NL_ARGMAX, NL_ARGMAX