diff options
-rw-r--r-- | Kernel/API/InodeWatcherEvent.h | 2 | ||||
-rw-r--r-- | Kernel/API/POSIX/sys/limits.h | 16 | ||||
-rw-r--r-- | Kernel/Heap/kmalloc.h | 2 | ||||
-rw-r--r-- | Kernel/Memory/VirtualRange.cpp | 1 | ||||
-rw-r--r-- | Kernel/Process.cpp | 2 | ||||
-rw-r--r-- | Kernel/Syscalls/execve.cpp | 1 | ||||
-rw-r--r-- | Kernel/Syscalls/mmap.cpp | 1 | ||||
-rw-r--r-- | Userland/Libraries/LibC/limits.h | 15 |
8 files changed, 19 insertions, 21 deletions
diff --git a/Kernel/API/InodeWatcherEvent.h b/Kernel/API/InodeWatcherEvent.h index 0c2cf8f9b4..9006ba6f83 100644 --- a/Kernel/API/InodeWatcherEvent.h +++ b/Kernel/API/InodeWatcherEvent.h @@ -10,7 +10,7 @@ #include <AK/Types.h> #ifdef KERNEL -# include <LibC/limits.h> +# include <Kernel/API/POSIX/sys/limits.h> #else # include <limits.h> #endif diff --git a/Kernel/API/POSIX/sys/limits.h b/Kernel/API/POSIX/sys/limits.h index 9afa33667c..93609efb13 100644 --- a/Kernel/API/POSIX/sys/limits.h +++ b/Kernel/API/POSIX/sys/limits.h @@ -7,6 +7,22 @@ #pragma once +// FIXME: This file can be included from Lagom, but it should only be included on Serenity. When that is the case, we can remove the ifdef +#ifndef PAGE_SIZE +# define PAGE_SIZE 4096 +#endif + +#define PATH_MAX 4096 +#if !defined MAXPATHLEN && defined PATH_MAX +# define MAXPATHLEN PATH_MAX +#endif + +#define NAME_MAX 255 + +#define HOST_NAME_MAX 64 + +#define TTY_NAME_MAX 32 + #define NGROUPS_MAX 32 #define PTHREAD_STACK_MIN (64 * 1024) // 64KiB diff --git a/Kernel/Heap/kmalloc.h b/Kernel/Heap/kmalloc.h index 77c89fa486..666cd6bcf7 100644 --- a/Kernel/Heap/kmalloc.h +++ b/Kernel/Heap/kmalloc.h @@ -7,7 +7,7 @@ #pragma once #include <AK/Types.h> -#include <LibC/limits.h> +#include <Kernel/API/POSIX/sys/limits.h> // For PAGE_SIZE. Everyone needs PAGE_SIZE #define KMALLOC_SCRUB_BYTE 0xbb #define KFREE_SCRUB_BYTE 0xaa diff --git a/Kernel/Memory/VirtualRange.cpp b/Kernel/Memory/VirtualRange.cpp index 607937f872..eea79f785a 100644 --- a/Kernel/Memory/VirtualRange.cpp +++ b/Kernel/Memory/VirtualRange.cpp @@ -8,7 +8,6 @@ #include <AK/Vector.h> #include <Kernel/Memory/MemoryManager.h> #include <Kernel/Memory/VirtualRange.h> -#include <LibC/limits.h> namespace Kernel::Memory { diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index 29c021d668..0a49bfab2a 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -18,6 +18,7 @@ # include <Kernel/Devices/KCOVDevice.h> #endif #include <Kernel/API/POSIX/errno.h> +#include <Kernel/API/POSIX/sys/limits.h> #include <Kernel/Devices/NullDevice.h> #include <Kernel/FileSystem/Custody.h> #include <Kernel/FileSystem/OpenFileDescription.h> @@ -38,7 +39,6 @@ #include <Kernel/Thread.h> #include <Kernel/ThreadTracer.h> #include <Kernel/TimerQueue.h> -#include <LibC/limits.h> namespace Kernel { diff --git a/Kernel/Syscalls/execve.cpp b/Kernel/Syscalls/execve.cpp index ba78e70fd6..865441948b 100644 --- a/Kernel/Syscalls/execve.cpp +++ b/Kernel/Syscalls/execve.cpp @@ -20,7 +20,6 @@ #include <Kernel/Random.h> #include <Kernel/Scheduler.h> #include <Kernel/Time/TimeManagement.h> -#include <LibC/limits.h> #include <LibELF/AuxiliaryVector.h> #include <LibELF/Image.h> #include <LibELF/Validation.h> diff --git a/Kernel/Syscalls/mmap.cpp b/Kernel/Syscalls/mmap.cpp index 78f1dcda97..e57c14550f 100644 --- a/Kernel/Syscalls/mmap.cpp +++ b/Kernel/Syscalls/mmap.cpp @@ -20,7 +20,6 @@ #include <Kernel/PerformanceEventBuffer.h> #include <Kernel/PerformanceManager.h> #include <Kernel/Process.h> -#include <LibC/limits.h> #include <LibELF/Validation.h> namespace Kernel { diff --git a/Userland/Libraries/LibC/limits.h b/Userland/Libraries/LibC/limits.h index 99177c3a5b..4be62111f9 100644 --- a/Userland/Libraries/LibC/limits.h +++ b/Userland/Libraries/LibC/limits.h @@ -12,21 +12,6 @@ #include <bits/stdint.h> #include <bits/wchar.h> -#ifndef PAGE_SIZE -# define PAGE_SIZE 4096 -#endif - -#define HOST_NAME_MAX 64 - -#define PATH_MAX 4096 -#if !defined MAXPATHLEN && defined PATH_MAX -# define MAXPATHLEN PATH_MAX -#endif - -#define NAME_MAX 255 - -#define TTY_NAME_MAX 32 - #define PIPE_BUF 4096 #define INT_MAX INT32_MAX |