summaryrefslogtreecommitdiff
path: root/pathconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'pathconf.c')
-rw-r--r--pathconf.c20
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;
+}