From 17cf3c143a50858c64c1531d18622c644a7aefa7 Mon Sep 17 00:00:00 2001 From: Conrad Pankoff Date: Mon, 2 Sep 2019 15:36:22 +1000 Subject: [PATCH] LibC: Support _PC_PATH_MAX in [f]pathconf --- Libraries/LibC/unistd.cpp | 12 ++++++++++++ Libraries/LibC/unistd.h | 1 + 2 files changed, 13 insertions(+) diff --git a/Libraries/LibC/unistd.cpp b/Libraries/LibC/unistd.cpp index 9c8f7e07aa..f87d52e672 100644 --- a/Libraries/LibC/unistd.cpp +++ b/Libraries/LibC/unistd.cpp @@ -413,6 +413,12 @@ long fpathconf(int fd, int name) { (void)fd; (void)name; + + switch (name) { + case _PC_PATH_MAX: + return PATH_MAX; + } + ASSERT_NOT_REACHED(); } @@ -420,6 +426,12 @@ long pathconf(const char* path, int name) { (void)path; (void)name; + + switch (name) { + case _PC_PATH_MAX: + return PATH_MAX; + } + ASSERT_NOT_REACHED(); } diff --git a/Libraries/LibC/unistd.h b/Libraries/LibC/unistd.h index 08cadfb408..3ae7eb1634 100644 --- a/Libraries/LibC/unistd.h +++ b/Libraries/LibC/unistd.h @@ -107,6 +107,7 @@ char* realpath(const char* pathname, char* buffer); enum { _PC_NAME_MAX, + _PC_PATH_MAX, }; #define HOST_NAME_MAX 64