1c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// Copyright (c) 2010 The Chromium Authors. All rights reserved. 2c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// Use of this source code is governed by a BSD-style license that can be 3c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// found in the LICENSE file. 4c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 5c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch#ifndef BASE_RAND_UTIL_C_H_ 6c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch#define BASE_RAND_UTIL_C_H_ 73345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick#pragma once 8c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 9c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch#ifdef __cplusplus 10c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdochextern "C" { 11c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch#endif 12c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 13c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// Note this *should* be in "namespace base" but the function is needed 14c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// from C so namespaces cannot be used. 15c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 16c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// Returns an FD for /dev/urandom, possibly pre-opened before sandboxing 17c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// was switched on. This is a C function so that Native Client can use it. 18c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdochint GetUrandomFD(void); 19c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 20c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch#ifdef __cplusplus 21c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch} 22c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch#endif 23c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch 24c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch#endif /* BASE_RAND_UTIL_C_H_ */ 25