libbinder: build ParcelFileDescriptor on Trusty
Adds ParcelFileDescriptor.cpp to the Trusty build
which in turn compiles some extra related code from
Parcel.cpp. This code uses fcntl(...O_DUPFD_CLOEXEC...)
to duplicate file descriptors which is not available
on Trusty (or other OSes), so we abstract the relevant
calls to that function in a wrapper in OS.cpp.
Bug: 224644083
Test: m
Test: build on Trusty
Change-Id: I2e0ee517e7c7b55458a6ee6db977985aab4d7c58
diff --git a/libs/binder/trusty/OS.cpp b/libs/binder/trusty/OS.cpp
index 187add4..bbfa381 100644
--- a/libs/binder/trusty/OS.cpp
+++ b/libs/binder/trusty/OS.cpp
@@ -32,4 +32,9 @@
return res == 1 ? OK : UNKNOWN_ERROR;
}
+status_t dupFileDescriptor(int oldFd, int* newFd) {
+ // TODO: implement separately
+ return INVALID_OPERATION;
+}
+
} // namespace android
diff --git a/libs/binder/trusty/rules.mk b/libs/binder/trusty/rules.mk
index 83475f5..d0d0861 100644
--- a/libs/binder/trusty/rules.mk
+++ b/libs/binder/trusty/rules.mk
@@ -36,6 +36,7 @@
$(LIBBINDER_DIR)/IInterface.cpp \
$(LIBBINDER_DIR)/IResultReceiver.cpp \
$(LIBBINDER_DIR)/Parcel.cpp \
+ $(LIBBINDER_DIR)/ParcelFileDescriptor.cpp \
$(LIBBINDER_DIR)/RpcServer.cpp \
$(LIBBINDER_DIR)/RpcSession.cpp \
$(LIBBINDER_DIR)/RpcState.cpp \