From: Waldemar Kozaczuk <[email protected]>
Committer: Waldemar Kozaczuk <[email protected]>
Branch: master

sysconf: support _SC_THREAD_STACK_MIN and _SC_LINE_MAX

New java 11 on latest Ubuntu calls sysconf to get value
of _SC_THREAD_STACK_MIN parameter to inquire about minimal
stack size and crashes when gets -1 from OSv. This patch
makes sysconf() return the same value Linux returns.

Similarly one of the libraries libtsm.so used by cli
needs value of _SC_LINE_MAX and this patch makes sysconf
handle this parameter as well.

Signed-off-by: Waldemar Kozaczuk <[email protected]>

---
diff --git a/runtime.cc b/runtime.cc
--- a/runtime.cc
+++ b/runtime.cc
@@ -362,6 +362,8 @@ long sysconf(int name)
     switch (name) {
     case _SC_CLK_TCK: return CLOCKS_PER_SEC;
     case _SC_PAGESIZE: return mmu::page_size;
+    case _SC_THREAD_STACK_MIN: return 16384;
+    case _SC_LINE_MAX: return 2048;
     case _SC_THREAD_PROCESS_SHARED: return true;
     case _SC_NPROCESSORS_ONLN: return sched::cpus.size();
     case _SC_NPROCESSORS_CONF: return sched::cpus.size();

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/0000000000008ce56b05d4c2fbf5%40google.com.

Reply via email to