github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/internal/syscall/unix/getrandom_solaris.go (about) 1 // Copyright 2021 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 5 package unix 6 7 // GetRandomFlag is a flag supported by the getrandom system call. 8 type GetRandomFlag uintptr 9 10 const ( 11 // GRND_NONBLOCK means return EAGAIN rather than blocking. 12 GRND_NONBLOCK GetRandomFlag = 0x0001 13 14 // GRND_RANDOM means use the /dev/random pool instead of /dev/urandom. 15 GRND_RANDOM GetRandomFlag = 0x0002 16 ) 17 18 // GetRandom calls the getrandom system call. 19 func GetRandom(p []byte, flags GetRandomFlag) (n int, err error)