From 10e3e8f6d43bbb9c03328dae2a9875f955fd0a86 Mon Sep 17 00:00:00 2001 From: thatdutchguy <209150+thatdutchguy@users.noreply.github.com> Date: Tue, 16 Mar 2021 11:05:23 -0700 Subject: [PATCH] Kernel: Add _SC_CLK_TCK to sysconf. Unbreaks the hatari port. --- Kernel/Syscalls/sysconf.cpp | 3 +++ Kernel/UnixTypes.h | 1 + Userland/Libraries/LibC/unistd.h | 1 + 3 files changed, 5 insertions(+) diff --git a/Kernel/Syscalls/sysconf.cpp b/Kernel/Syscalls/sysconf.cpp index 4a3b13b7a5..c6ae283190 100644 --- a/Kernel/Syscalls/sysconf.cpp +++ b/Kernel/Syscalls/sysconf.cpp @@ -44,6 +44,9 @@ KResultOr Process::sys$sysconf(int name) return TTY_NAME_MAX; case _SC_GETPW_R_SIZE_MAX: return 4096; // idk + case _SC_CLK_TCK: + // FIXME: should return Number of clock intervals per second for times() + return 100; // seems to be 100 on x86_64 default: return EINVAL; } diff --git a/Kernel/UnixTypes.h b/Kernel/UnixTypes.h index e200775dba..6932baae62 100644 --- a/Kernel/UnixTypes.h +++ b/Kernel/UnixTypes.h @@ -63,6 +63,7 @@ enum { _SC_TTY_NAME_MAX, _SC_PAGESIZE, _SC_GETPW_R_SIZE_MAX, + _SC_CLK_TCK, }; #define PERF_EVENT_SAMPLE 0 diff --git a/Userland/Libraries/LibC/unistd.h b/Userland/Libraries/LibC/unistd.h index 6c978e2dc1..a4ead75035 100644 --- a/Userland/Libraries/LibC/unistd.h +++ b/Userland/Libraries/LibC/unistd.h @@ -177,6 +177,7 @@ enum { _SC_TTY_NAME_MAX, _SC_PAGESIZE, _SC_GETPW_R_SIZE_MAX, + _SC_CLK_TCK, }; #define _SC_NPROCESSORS_CONF _SC_NPROCESSORS_CONF