Skip to content

Commit

Permalink
Fix compilation.
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfishcode committed Dec 11, 2024
1 parent d193459 commit 3aea25b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libc-top-half/musl/src/conf/sysconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include <signal.h>
#endif
#include <sys/sysinfo.h>
#include <sys/auxv.h>
#ifdef __wasilibc_unmodified_upstream
#include <sys/auxv.h>
#include "syscall.h"
#endif
#include "libc.h"
Expand Down Expand Up @@ -284,12 +284,14 @@ long sysconf(int name)
case JT_ZERO & 255:
return 0;
}
#ifdef __wasilibc_unmodified_upstream // WASI has no auxv
case JT_MINSIGSTKSZ & 255:
case JT_SIGSTKSZ & 255: ;
long val = __getauxval(AT_MINSIGSTKSZ);
if (val < MINSIGSTKSZ) val = MINSIGSTKSZ;
if (values[name] == JT_SIGSTKSZ)
val += SIGSTKSZ - MINSIGSTKSZ;
return val;
#endif
return values[name];
}

0 comments on commit 3aea25b

Please sign in to comment.