diff options
author | Ian C <ianc@noddybox.co.uk> | 2010-11-09 08:43:49 +0000 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2010-11-09 08:43:49 +0000 |
commit | c84fd5105b380c7daf3a6f1bc3a23ba9c4c0adb1 (patch) | |
tree | 2b00b5ff658deffeb733932b4b218b14e6cc90bc | |
parent | 07ad92f856c98327f2219a4211516257dcf88f23 (diff) |
Added pathconf tool.
-rw-r--r-- | pathconf.c | 20 |
1 files changed, 20 insertions, 0 deletions
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 <stdlib.h> +#include <stdio.h> +#include <unistd.h> + +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; +} |