Browse Source

Kernel: Add _SC_CLK_TCK to sysconf.
Unbreaks the hatari port.

thatdutchguy 4 years ago
parent
commit
10e3e8f6d4
3 changed files with 5 additions and 0 deletions
  1. 3 0
      Kernel/Syscalls/sysconf.cpp
  2. 1 0
      Kernel/UnixTypes.h
  3. 1 0
      Userland/Libraries/LibC/unistd.h

+ 3 - 0
Kernel/Syscalls/sysconf.cpp

@@ -44,6 +44,9 @@ KResultOr<long> 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;
     }

+ 1 - 0
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

+ 1 - 0
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