Loading
Commits on Source 17
-
cznic authored
-
cznic authored
-
cznic authored
-
cznic authored
-
cznic authored
-
cznic authored
-
cznic authored
-
cznic authored
-
Kieran Klukas authored
srandomdev() seeds the random number generator from /dev/urandom. The previous stub panicked with todo(""), breaking any program that calls it on macOS (e.g. SQLite AFP locking path on network volumes). Seed the shared randomGen from crypto/rand, matching the existing pattern used by Xarc4random_buf. -
Kieran Klukas authored
-
cznic authored
-
cznic authored
Xinitstate built a math/rand.Rand and immediately discarded it, so initstate(seed, ...) was a silent no-op on the non-musl path (darwin/*bsd/illumos) while the musl/linux build reseeds via srandom. Seed the shared randomGen under randomMu instead, matching the just-added Xsrandomdev and bringing the non-musl path in line with musl. No API change: signature unchanged, still returns NULL, already in the capi manifests. setstate stays unsupported because random() is modeled by a single global generator with no per-call state buffer to switch to. Co-Authored-By:Claude Opus 4.8 <noreply@anthropic.com>
-
cznic authored
setstate() returned EINVAL, injecting a spurious error into callers doing the standard initstate/setstate save/restore idiom. random(3) is modeled by a single global generator with no independent saved stream to switch to, so treat setstate as a no-op and return the passed (non-NULL) pointer to signal success instead of failing. Also remove the orphaned staticRandomData comment whose only user was the discarded rand.New call removed in the previous commit. Co-Authored-By:Claude Opus 4.8 <noreply@anthropic.com>
-
cznic authored
-
cznic authored
-
cznic authored
wasm2c's --enable-threads output routes every shared-memory load/store through C11 atomics (the shared memory's data pointer is _Atomic volatile), including plain f32/f64 access. libc provided the Int/Uint widths but no float variants, so such a module failed to link with undefined __atomic_loadFloat32 / __atomic_loadFloat64 / __atomic_storeFloat32 / __atomic_storeFloat64. Add the four out-parameter helpers, each delegating to its same-width integer sibling (an atomic op on the value's bit pattern). wasm has no atomic-float read-modify-write, so load and store are the complete set. Verified end-to-end: a shared-memory f32/f64 module translated by wa2c/wasm2c (--enable-threads) -> ccgo -> Go builds and runs correctly against this libc. Co-Authored-By:Claude Opus 4.8 (1M context) <noreply@anthropic.com>