summaryrefslogtreecommitdiff
path: root/libs/binder/OS.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/binder/OS.cpp')
-rw-r--r--libs/binder/OS.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/libs/binder/OS.cpp b/libs/binder/OS.cpp
index 6eb72726f5..cc4a03ba67 100644
--- a/libs/binder/OS.cpp
+++ b/libs/binder/OS.cpp
@@ -48,4 +48,14 @@ status_t getRandomBytes(uint8_t* data, size_t size) {
return OK;
}
+status_t dupFileDescriptor(int oldFd, int* newFd) {
+ int ret = fcntl(oldFd, F_DUPFD_CLOEXEC, 0);
+ if (ret < 0) {
+ return -errno;
+ }
+
+ *newFd = ret;
+ return OK;
+}
+
} // namespace android