Remove getrandom_fillin.h

Update-Note: To build for Linux, BoringSSL now requires Linux headers
from 3.17 or later, released over 11 years ago in October 2014. This
change does not impact runtime kernel requirements, only available
headers at build time.

Bug: 446280907
Change-Id: I3217e2606a7db7a3860525b194ea51f154ccce8b
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/89847
Auto-Submit: David Benjamin <davidben@google.com>
Commit-Queue: Xiangfei Ding <xfding@google.com>
Reviewed-by: Xiangfei Ding <xfding@google.com>
diff --git a/build.json b/build.json
index 45fb7c4..3dfd6de 100644
--- a/build.json
+++ b/build.json
@@ -551,7 +551,6 @@
             "crypto/pkcs8/internal.h",
             "crypto/poly1305/internal.h",
             "crypto/pool/internal.h",
-            "crypto/rand/getrandom_fillin.h",
             "crypto/rand/internal.h",
             "crypto/rsa/internal.h",
             "crypto/spake2plus/internal.h",
diff --git a/crypto/rand/getrandom_fillin.h b/crypto/rand/getrandom_fillin.h
deleted file mode 100644
index b67276d..0000000
--- a/crypto/rand/getrandom_fillin.h
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright 2020 The BoringSSL Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef OPENSSL_HEADER_CRYPTO_RAND_GETRANDOM_FILLIN_H
-#define OPENSSL_HEADER_CRYPTO_RAND_GETRANDOM_FILLIN_H
-
-#include <openssl/base.h>
-
-
-#if defined(OPENSSL_LINUX)
-
-#include <sys/syscall.h>
-
-// TODO(crbug.com/446280907): Can we assume that __NR_getrandom is defined?
-#if defined(OPENSSL_X86_64)
-#define EXPECTED_NR_getrandom 318
-#elif defined(OPENSSL_X86)
-#define EXPECTED_NR_getrandom 355
-#elif defined(OPENSSL_AARCH64)
-#define EXPECTED_NR_getrandom 278
-#elif defined(OPENSSL_ARM)
-#define EXPECTED_NR_getrandom 384
-#elif defined(OPENSSL_RISCV64)
-#define EXPECTED_NR_getrandom 278
-#endif
-
-#if !defined(__NR_getrandom) && defined(EXPECTED_NR_getrandom)
-#define __NR_getrandom EXPECTED_NR_getrandom
-#endif
-
-#if !defined(__NR_getrandom)
-#error "__NR_getrandom was not defined"
-#endif
-
-#if defined(EXPECTED_NR_getrandom) && __NR_getrandom != EXPECTED_NR_getrandom
-#error "system call number for getrandom is not the expected value"
-#endif
-
-#if !defined(GRND_NONBLOCK)
-#define GRND_NONBLOCK 1
-#endif
-
-#endif  // OPENSSL_LINUX
-
-
-#endif  // OPENSSL_HEADER_CRYPTO_RAND_GETRANDOM_FILLIN_H
diff --git a/crypto/rand/urandom.cc b/crypto/rand/urandom.cc
index afcd462..d06ade7 100644
--- a/crypto/rand/urandom.cc
+++ b/crypto/rand/urandom.cc
@@ -25,12 +25,12 @@
 
 #include <errno.h>
 #include <fcntl.h>
+#include <linux/random.h>
 #include <stdio.h>
 #include <sys/syscall.h>
 #include <unistd.h>
 
 #include "../internal.h"
-#include "getrandom_fillin.h"
 
 
 using namespace bssl;
diff --git a/crypto/rand/urandom_test.cc b/crypto/rand/urandom_test.cc
index 21cd329..f4044bf 100644
--- a/crypto/rand/urandom_test.cc
+++ b/crypto/rand/urandom_test.cc
@@ -24,7 +24,6 @@
 #include "../bcm_support.h"
 #include "../fipsmodule/rand/internal.h"
 #include "../internal.h"
-#include "getrandom_fillin.h"
 #include "internal.h"
 
 
diff --git a/gen/sources.bzl b/gen/sources.bzl
index c558749..006072f 100644
--- a/gen/sources.bzl
+++ b/gen/sources.bzl
@@ -681,7 +681,6 @@
     "crypto/pkcs8/internal.h",
     "crypto/poly1305/internal.h",
     "crypto/pool/internal.h",
-    "crypto/rand/getrandom_fillin.h",
     "crypto/rand/internal.h",
     "crypto/rsa/internal.h",
     "crypto/spake2plus/internal.h",
diff --git a/gen/sources.cmake b/gen/sources.cmake
index 28b63d7..1483617 100644
--- a/gen/sources.cmake
+++ b/gen/sources.cmake
@@ -703,7 +703,6 @@
   crypto/pkcs8/internal.h
   crypto/poly1305/internal.h
   crypto/pool/internal.h
-  crypto/rand/getrandom_fillin.h
   crypto/rand/internal.h
   crypto/rsa/internal.h
   crypto/spake2plus/internal.h
diff --git a/gen/sources.gni b/gen/sources.gni
index eb83060..8212721 100644
--- a/gen/sources.gni
+++ b/gen/sources.gni
@@ -681,7 +681,6 @@
   "crypto/pkcs8/internal.h",
   "crypto/poly1305/internal.h",
   "crypto/pool/internal.h",
-  "crypto/rand/getrandom_fillin.h",
   "crypto/rand/internal.h",
   "crypto/rsa/internal.h",
   "crypto/spake2plus/internal.h",
diff --git a/gen/sources.json b/gen/sources.json
index 6c08a9c..28cc2b4 100644
--- a/gen/sources.json
+++ b/gen/sources.json
@@ -663,7 +663,6 @@
       "crypto/pkcs8/internal.h",
       "crypto/poly1305/internal.h",
       "crypto/pool/internal.h",
-      "crypto/rand/getrandom_fillin.h",
       "crypto/rand/internal.h",
       "crypto/rsa/internal.h",
       "crypto/spake2plus/internal.h",
diff --git a/gen/sources.mk b/gen/sources.mk
index d0b18b2..06e0116 100644
--- a/gen/sources.mk
+++ b/gen/sources.mk
@@ -671,7 +671,6 @@
   crypto/pkcs8/internal.h \
   crypto/poly1305/internal.h \
   crypto/pool/internal.h \
-  crypto/rand/getrandom_fillin.h \
   crypto/rand/internal.h \
   crypto/rsa/internal.h \
   crypto/spake2plus/internal.h \