Kernel: Implement sysconf(_SC_SYMLOOP_MAX)
Not much to say here, this is an implementation of this call that accesses the actual limit constant that's used by the VirtualFileSystem class. As a side note, this is required for my eventual Qt port.
This commit is contained in:
parent
f75bab2a25
commit
86b249f02f
Notes:
sideshowbarker
2024-07-17 22:28:39 +09:00
Author: https://github.com/MartinBriza Commit: https://github.com/SerenityOS/serenity/commit/86b249f02fa Pull-request: https://github.com/SerenityOS/serenity/pull/11349 Reviewed-by: https://github.com/BertalanD ✅ Reviewed-by: https://github.com/timschumi ✅
2 changed files with 5 additions and 0 deletions
Kernel
|
@ -38,6 +38,7 @@ enum {
|
|||
_SC_PAGESIZE,
|
||||
_SC_GETPW_R_SIZE_MAX,
|
||||
_SC_CLK_TCK,
|
||||
_SC_SYMLOOP_MAX,
|
||||
};
|
||||
|
||||
#define _SC_MONOTONIC_CLOCK _SC_MONOTONIC_CLOCK
|
||||
|
@ -49,6 +50,7 @@ enum {
|
|||
#define _SC_TTY_NAME_MAX _SC_TTY_NAME_MAX
|
||||
#define _SC_GETPW_R_SIZE_MAX _SC_GETPW_R_SIZE_MAX
|
||||
#define _SC_CLK_TCK _SC_CLK_TCK
|
||||
#define _SC_SYMLOOP_MAX _SC_SYMLOOP_MAX
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <Kernel/FileSystem/VirtualFileSystem.h>
|
||||
#include <Kernel/Process.h>
|
||||
#include <Kernel/Time/TimeManagement.h>
|
||||
|
||||
|
@ -30,6 +31,8 @@ ErrorOr<FlatPtr> Process::sys$sysconf(int name)
|
|||
return 4096; // idk
|
||||
case _SC_CLK_TCK:
|
||||
return TimeManagement::the().ticks_per_second();
|
||||
case _SC_SYMLOOP_MAX:
|
||||
return Kernel::VirtualFileSystem::symlink_recursion_limit;
|
||||
default:
|
||||
return EINVAL;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue