diff options
author | Peter Elliott <pelliott@ualberta.ca> | 2021-07-23 00:34:22 -0600 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-22 10:29:06 +0200 |
commit | f16aba405f68ad27f2e1188547d34e894978c608 (patch) | |
tree | 0dbc71e23154ab2a8f4e7e9c4c9faab5e9462814 /Userland/Libraries/LibC | |
parent | d9ecb3ecfae4b019b671b194c33962da0de98d5b (diff) | |
download | serenity-f16aba405f68ad27f2e1188547d34e894978c608.zip |
LibC: Add LINK_MAX and _PC_LINK_MAX
LINK_MAX was set arbitrarily to 4096, this is not an actual system
limit.
Diffstat (limited to 'Userland/Libraries/LibC')
-rw-r--r-- | Userland/Libraries/LibC/limits.h | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibC/unistd.cpp | 6 | ||||
-rw-r--r-- | Userland/Libraries/LibC/unistd.h | 3 |
3 files changed, 9 insertions, 2 deletions
diff --git a/Userland/Libraries/LibC/limits.h b/Userland/Libraries/LibC/limits.h index cb9954e7ee..69130b67a5 100644 --- a/Userland/Libraries/LibC/limits.h +++ b/Userland/Libraries/LibC/limits.h @@ -80,6 +80,8 @@ #define SSIZE_MAX 2147483647 +#define LINK_MAX 4096 + #ifdef __USE_POSIX # include <bits/posix1_lim.h> #endif diff --git a/Userland/Libraries/LibC/unistd.cpp b/Userland/Libraries/LibC/unistd.cpp index fa22393b3e..b4f7c76e36 100644 --- a/Userland/Libraries/LibC/unistd.cpp +++ b/Userland/Libraries/LibC/unistd.cpp @@ -619,7 +619,7 @@ int mknod(const char* pathname, mode_t mode, dev_t dev) __RETURN_WITH_ERRNO(rc, rc, -1); } -long fpathconf([[maybe_unused]] int fd, [[maybe_unused]] int name) +long fpathconf([[maybe_unused]] int fd, int name) { switch (name) { case _PC_NAME_MAX: @@ -628,6 +628,8 @@ long fpathconf([[maybe_unused]] int fd, [[maybe_unused]] int name) return PATH_MAX; case _PC_VDISABLE: return _POSIX_VDISABLE; + case _PC_LINK_MAX: + return LINK_MAX; } VERIFY_NOT_REACHED(); @@ -642,6 +644,8 @@ long pathconf([[maybe_unused]] const char* path, int name) return PATH_MAX; case _PC_PIPE_BUF: return PIPE_BUF; + case _PC_LINK_MAX: + return LINK_MAX; } VERIFY_NOT_REACHED(); diff --git a/Userland/Libraries/LibC/unistd.h b/Userland/Libraries/LibC/unistd.h index e681ae1b6a..2cdfb4df5c 100644 --- a/Userland/Libraries/LibC/unistd.h +++ b/Userland/Libraries/LibC/unistd.h @@ -121,7 +121,8 @@ enum { _PC_NAME_MAX, _PC_PATH_MAX, _PC_PIPE_BUF, - _PC_VDISABLE + _PC_VDISABLE, + _PC_LINK_MAX }; #define _POSIX_MONOTONIC_CLOCK 200112L |