From c84fd5105b380c7daf3a6f1bc3a23ba9c4c0adb1 Mon Sep 17 00:00:00 2001 From: Ian C Date: Tue, 9 Nov 2010 08:43:49 +0000 Subject: Added pathconf tool. --- pathconf.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 pathconf.c (limited to 'pathconf.c') diff --git a/pathconf.c b/pathconf.c new file mode 100644 index 0000000..5379c68 --- /dev/null +++ b/pathconf.c @@ -0,0 +1,20 @@ +#include +#include +#include + +static void dump(const char *p) +{ + printf("_PC_FILESIZEBITS = %ld\n", pathconf(p, _PC_FILESIZEBITS)); + printf("_PC_LINK_MAX = %ld\n", pathconf(p, _PC_LINK_MAX)); + printf("_PC_MAX_CANON = %ld\n", pathconf(p, _PC_MAX_CANON)); + printf("_PC_MAX_INPUT = %ld\n", pathconf(p, _PC_MAX_INPUT)); + printf("_PC_NAME_MAX = %ld\n", pathconf(p, _PC_NAME_MAX)); + printf("_PC_PATH_MAX = %ld\n", pathconf(p, _PC_PATH_MAX)); + printf("_PC_PIPE_BUF = %ld\n", pathconf(p, _PC_PIPE_BUF)); +} + +int main(int argc, char *argv[]) +{ + dump(argv[1] ? argv[1]:"."); + return 0; +} -- cgit v1.2.3