Add DupCloexec to atomically dup and set FD_CLOEXEC.

Bug: http://b/113558485
Test: treehugger
Change-Id: I1ad0fb32f1990d92c717d2208a66cfbc0b9ef361
diff --git a/libartbase/base/file_utils.h b/libartbase/base/file_utils.h
index 063393b..c249bcc 100644
--- a/libartbase/base/file_utils.h
+++ b/libartbase/base/file_utils.h
@@ -78,6 +78,9 @@
 // Return whether the location is on system/framework (i.e. android_root/framework).
 bool LocationIsOnSystemFramework(const char* location);
 
+// dup(2), except setting the O_CLOEXEC flag atomically, when possible.
+int DupCloexec(int fd);
+
 }  // namespace art
 
 #endif  // ART_LIBARTBASE_BASE_FILE_UTILS_H_