binder: RPC uses non-blocking sockets.
With TLS, even though poll() may have returned for an FD,
there may not be a complete packet available, so I/O operations
within libssl may block and not interruptible by the shutdown
trigger.
Hence, always use non-blocking sockets.
Test: binderRpcTest
Bug: 195683291
Change-Id: I372e8c3bf010c672b1c4b9f7cb5b789ca20c9480
diff --git a/libs/binder/Utils.h b/libs/binder/Utils.h
index f94b158..1e383da 100644
--- a/libs/binder/Utils.h
+++ b/libs/binder/Utils.h
@@ -17,9 +17,14 @@
#include <cstdint>
#include <stddef.h>
+#include <android-base/result.h>
+#include <android-base/unique_fd.h>
+
namespace android {
// avoid optimizations
void zeroMemory(uint8_t* data, size_t size);
+android::base::Result<void> setNonBlocking(android::base::borrowed_fd fd);
+
} // namespace android