mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-24 06:12:27 +00:00
Improve linenoise and get it working on Windows
Some progress has been made on introducing completion but there's been difficulties using the Python C API to get local shell variables.
This commit is contained in:
parent
968474d291
commit
5029e20bef
23 changed files with 408 additions and 209 deletions
|
@ -45,10 +45,11 @@ static bool have_getrandom;
|
|||
* This random number seed generator blends information from:
|
||||
*
|
||||
* - getrandom() on Linux
|
||||
* - RtlGenRandom() on Windows
|
||||
* - getentropy() on XNU and OpenBSD
|
||||
* - sysctl(KERN_ARND) on FreeBSD and NetBSD
|
||||
* - RDSEED on Broadwell+ and Xen+ unless GRND_NORDRND
|
||||
* - RDRAND on Ivybridge+ and Xen+ unless GRND_NORDRND|GRND_RANDOM
|
||||
* - RDRAND on Ivybridge+ and Xen+ unless GRND_NORDRND
|
||||
*
|
||||
* The following flags may be specified:
|
||||
*
|
||||
|
@ -75,7 +76,9 @@ ssize_t getrandom(void *p, size_t n, unsigned f) {
|
|||
sigset_t neu, old;
|
||||
if (n > 256) n = 256;
|
||||
if (!IsTiny() &&
|
||||
(f & ~(GRND_RANDOM | GRND_NONBLOCK | GRND_NORDRND | GRND_NOSYSTEM))) {
|
||||
((f & ~(GRND_RANDOM | GRND_NONBLOCK | GRND_NORDRND | GRND_NOSYSTEM)) ||
|
||||
(f & (GRND_NORDRND | GRND_NOSYSTEM)) ==
|
||||
(GRND_NORDRND | GRND_NOSYSTEM))) {
|
||||
return einval();
|
||||
}
|
||||
if (!(f & GRND_NOSYSTEM)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue