Fix building libbinder against musl
musl libc uses the posix definition of msg_iovlen as int. Change the
niovs argument to an int, make sure it is not negative, and cast it to
size_t if necessary.
Bug: 190084016
Test: m USE_HOST_MUSL=true host-native
Change-Id: I6ff9206e9e7396f2f89622735f790b4fac18f76c
diff --git a/libs/binder/RpcState.h b/libs/binder/RpcState.h
index 5cad394..f4a0894 100644
--- a/libs/binder/RpcState.h
+++ b/libs/binder/RpcState.h
@@ -180,11 +180,10 @@
[[nodiscard]] status_t rpcSend(const sp<RpcSession::RpcConnection>& connection,
const sp<RpcSession>& session, const char* what, iovec* iovs,
- size_t niovs,
- const std::function<status_t()>& altPoll = nullptr);
+ int niovs, const std::function<status_t()>& altPoll = nullptr);
[[nodiscard]] status_t rpcRec(const sp<RpcSession::RpcConnection>& connection,
const sp<RpcSession>& session, const char* what, iovec* iovs,
- size_t niovs);
+ int niovs);
[[nodiscard]] status_t waitForReply(const sp<RpcSession::RpcConnection>& connection,
const sp<RpcSession>& session, Parcel* reply);