Add runtime option -Xbootclasspathfds: for pre-opened fds
The new option allows the client to pass a pre-opened fds to the
runtime. The number of elements must match the number of BCP jars
specified in -Xbootclasspath. An fd of negative number is a valid
option, in such case the runtime will still open the jar in the
corresponding path in -Xbootclasspath.
Example: -Xbootclasspathfds:10:11:-1:12
The option is currently only used in "unstarted runtime", but will also
be used elsewhere in the follow-up changes.
Bug: 187327262
Test: patch odrefresh to use the option, no longer seeing such openat(2)
Test: m test-art-host-gtest
Change-Id: I1bebbd80136419c03ac1309a8cb8229a0fd69838
diff --git a/runtime/dexopt_test.cc b/runtime/dexopt_test.cc
index abde17c..f0b31cc 100644
--- a/runtime/dexopt_test.cc
+++ b/runtime/dexopt_test.cc
@@ -176,6 +176,7 @@
ArrayRef<const std::string>(&image_location, 1),
ArrayRef<const std::string>(Runtime::Current()->GetBootClassPathLocations()),
ArrayRef<const std::string>(Runtime::Current()->GetBootClassPath()),
+ ArrayRef<const int>(Runtime::Current()->GetBootClassPathFds()),
kRuntimeISA,
&error_msg);
ASSERT_EQ(!with_alternate_image, match) << error_msg;