options/posix: Implement getpagesize()
This commit is contained in:
parent
aae65d7de6
commit
4e2ff591e0
|
@ -5,6 +5,7 @@ rtdl_include_dirs = [
|
||||||
]
|
]
|
||||||
libc_include_dirs = [
|
libc_include_dirs = [
|
||||||
include_directories('options/internal/include'),
|
include_directories('options/internal/include'),
|
||||||
|
include_directories('options/internal/x86_64-include'),
|
||||||
include_directories('options/elf/include'),
|
include_directories('options/elf/include'),
|
||||||
include_directories('options/lsb/include'),
|
include_directories('options/lsb/include'),
|
||||||
include_directories('options/glibc/include'),
|
include_directories('options/glibc/include'),
|
||||||
|
|
12
options/internal/x86_64-include/mlibc/arch-defs.hpp
Normal file
12
options/internal/x86_64-include/mlibc/arch-defs.hpp
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#ifndef MLIBC_ARCH_DEFS_HPP
|
||||||
|
#define MLIBC_ARCH_DEFS_HPP
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
|
namespace mlibc {
|
||||||
|
|
||||||
|
inline constexpr size_t page_size = 0x1000;
|
||||||
|
|
||||||
|
} // namespace mlibc
|
||||||
|
|
||||||
|
#endif // MLIBC_ARCH_DEFS_HPP
|
|
@ -5,6 +5,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include <mlibc/arch-defs.hpp>
|
||||||
#include <mlibc/debug.hpp>
|
#include <mlibc/debug.hpp>
|
||||||
#include <mlibc/sysdeps.hpp>
|
#include <mlibc/sysdeps.hpp>
|
||||||
|
|
||||||
|
@ -285,7 +286,7 @@ void sync(void) {
|
||||||
}
|
}
|
||||||
unsigned long sysconf(int number) {
|
unsigned long sysconf(int number) {
|
||||||
if(number == _SC_PAGE_SIZE) {
|
if(number == _SC_PAGE_SIZE) {
|
||||||
return 4096;
|
return mlibc::page_size;
|
||||||
}else{
|
}else{
|
||||||
mlibc::panicLogger() << "\e[31mmlibc: sysconf() call is not implemented\e[39m"
|
mlibc::panicLogger() << "\e[31mmlibc: sysconf() call is not implemented\e[39m"
|
||||||
<< frg::endlog;
|
<< frg::endlog;
|
||||||
|
@ -331,9 +332,8 @@ int unlinkat(int, const char *, int) {
|
||||||
__builtin_unreachable();
|
__builtin_unreachable();
|
||||||
}
|
}
|
||||||
|
|
||||||
int getpagesize(void) {
|
int getpagesize() {
|
||||||
__ensure(!"Not implemented");
|
return mlibc::page_size;
|
||||||
__builtin_unreachable();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
char *get_current_dir_name(void) {
|
char *get_current_dir_name(void) {
|
||||||
|
|
Loading…
Reference in a new issue