1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
8 #include "base/logging.h"
9 #include "components/nacl/loader/nonsfi/irt_interfaces.h"
10 #include "components/nacl/loader/nonsfi/irt_util.h"
17 int secure_random_fd
= -1;
19 int IrtGetRandomBytes(void* buf
, size_t count
, size_t* nread
) {
20 DCHECK_NE(secure_random_fd
, -1);
21 return CheckErrorWithResult(read(secure_random_fd
, buf
, count
),
27 const nacl_irt_random kIrtRandom
= {
31 void SetUrandomFd(int fd
) {
32 DCHECK_EQ(secure_random_fd
, -1);
33 secure_random_fd
= fd
;