mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-26 12:41:59 +03:00
Kernel+LibC: Move name length constants to Kernel/API from limits.h
Reduce inclusion of limits.h as much as possible at the same time. This does mean that kmalloc.h is now including Kernel/API/POSIX/limits.h instead of LibC/limits.h, but the scope could be limited a lot more. Basically every file in the kernel includes kmalloc.h, and needs the limits.h include for PAGE_SIZE.
This commit is contained in:
parent
046c23f567
commit
ddea37b521
Notes:
sideshowbarker
2024-07-17 01:25:26 +09:00
Author: https://github.com/ADKaster Commit: https://github.com/SerenityOS/serenity/commit/ddea37b521 Pull-request: https://github.com/SerenityOS/serenity/pull/16896
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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 {
|
||||
|
||||
|
@ -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 {
|
||||
|
||||
|
@ -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>
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user