parent
ea12d45337
commit
883c54e077
|
@ -1,6 +1,6 @@
|
|||
USING: alien.c-types io io.files io.nonblocking kernel
|
||||
namespaces random io.encodings.binary singleton init
|
||||
accessors ;
|
||||
accessors system ;
|
||||
IN: random.unix
|
||||
|
||||
TUPLE: unix-random path ;
|
||||
|
@ -15,7 +15,14 @@ C: <unix-random> unix-random
|
|||
M: unix-random random-bytes* ( n tuple -- byte-array )
|
||||
path>> file-read-unbuffered ;
|
||||
|
||||
[
|
||||
"/dev/random" <unix-random> secure-random-generator set-global
|
||||
"/dev/urandom" <unix-random> insecure-random-generator set-global
|
||||
] "random.unix" add-init-hook
|
||||
os "openbsd" = [
|
||||
[
|
||||
"/dev/srandom" <unix-random> secure-random-generator set-global
|
||||
"/dev/prandom" <unix-random> insecure-random-generator set-global
|
||||
] "random.unix" add-init-hook
|
||||
] [
|
||||
[
|
||||
"/dev/random" <unix-random> secure-random-generator set-global
|
||||
"/dev/urandom" <unix-random> insecure-random-generator set-global
|
||||
] "random.unix" add-init-hook
|
||||
] if
|
||||
|
|
Loading…
Reference in New Issue