1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:04:59 +00:00

LibC: Add LINK_MAX and _PC_LINK_MAX

LINK_MAX was set arbitrarily to 4096, this is not an actual system
limit.
This commit is contained in:
Peter Elliott 2021-07-23 00:34:22 -06:00 committed by Andreas Kling
parent d9ecb3ecfa
commit f16aba405f
3 changed files with 9 additions and 2 deletions

View file

@ -80,6 +80,8 @@
#define SSIZE_MAX 2147483647
#define LINK_MAX 4096
#ifdef __USE_POSIX
# include <bits/posix1_lim.h>
#endif

View file

@ -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();

View file

@ -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