rand_linux.go 570 B

1234567891011121314
  1. // Copyright 2014 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package rand
  5. // maxGetRandomRead is the maximum number of bytes to ask for in one call to the
  6. // getrandom() syscall. In linux at most 2^25-1 bytes will be returned per call.
  7. // From the manpage
  8. //
  9. // * When reading from the urandom source, a maximum of 33554431 bytes
  10. // is returned by a single call to getrandom() on systems where int
  11. // has a size of 32 bits.
  12. const maxGetRandomRead = (1 << 25) - 1