diff options
author | 2025-01-28 08:44:49 -0800 | |
---|---|---|
committer | 2025-01-28 08:44:49 -0800 | |
commit | 7317ccbb67388b9ec3e2f7af7814108f37eda703 (patch) | |
tree | 837559914fccc608780266d517c8045d8c482e74 /libs/binder/IPCThreadState.cpp | |
parent | a5f7d9f7b8db227c0d72664394513ed58fe38b59 (diff) | |
parent | e8e12433e1f7628904311347f9aeb455c2cb0a4f (diff) |
Merge "Enable compilation of libbinder on Fuchsia" into main
Diffstat (limited to 'libs/binder/IPCThreadState.cpp')
-rw-r--r-- | libs/binder/IPCThreadState.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/libs/binder/IPCThreadState.cpp b/libs/binder/IPCThreadState.cpp index 623e7b9139..f7e0915f15 100644 --- a/libs/binder/IPCThreadState.cpp +++ b/libs/binder/IPCThreadState.cpp @@ -38,6 +38,10 @@ #include "Utils.h" #include "binder_module.h" +#if (defined(__ANDROID__) || defined(__Fuchsia__)) && !defined(BINDER_WITH_KERNEL_IPC) +#error Android and Fuchsia are expected to have BINDER_WITH_KERNEL_IPC +#endif + #if LOG_NDEBUG #define IF_LOG_TRANSACTIONS() if (false) @@ -1215,7 +1219,7 @@ status_t IPCThreadState::talkWithDriver(bool doReceive) std::string message = logStream.str(); ALOGI("%s", message.c_str()); } -#if defined(__ANDROID__) +#if defined(BINDER_WITH_KERNEL_IPC) if (ioctl(mProcess->mDriverFD, BINDER_WRITE_READ, &bwr) >= 0) err = NO_ERROR; else @@ -1604,7 +1608,7 @@ void IPCThreadState::threadDestructor(void *st) IPCThreadState* const self = static_cast<IPCThreadState*>(st); if (self) { self->flushCommands(); -#if defined(__ANDROID__) +#if defined(BINDER_WITH_KERNEL_IPC) if (self->mProcess->mDriverFD >= 0) { ioctl(self->mProcess->mDriverFD, BINDER_THREAD_EXIT, 0); } @@ -1620,7 +1624,7 @@ status_t IPCThreadState::getProcessFreezeInfo(pid_t pid, uint32_t *sync_received binder_frozen_status_info info = {}; info.pid = pid; -#if defined(__ANDROID__) +#if defined(BINDER_WITH_KERNEL_IPC) if (ioctl(self()->mProcess->mDriverFD, BINDER_GET_FROZEN_INFO, &info) < 0) ret = -errno; #endif @@ -1639,7 +1643,7 @@ status_t IPCThreadState::freeze(pid_t pid, bool enable, uint32_t timeout_ms) { info.timeout_ms = timeout_ms; -#if defined(__ANDROID__) +#if defined(BINDER_WITH_KERNEL_IPC) if (ioctl(self()->mProcess->mDriverFD, BINDER_FREEZE, &info) < 0) ret = -errno; #endif @@ -1657,7 +1661,7 @@ void IPCThreadState::logExtendedError() { if (!ProcessState::isDriverFeatureEnabled(ProcessState::DriverFeature::EXTENDED_ERROR)) return; -#if defined(__ANDROID__) +#if defined(BINDER_WITH_KERNEL_IPC) if (ioctl(self()->mProcess->mDriverFD, BINDER_GET_EXTENDED_ERROR, &ee) < 0) { ALOGE("Failed to get extended error: %s", strerror(errno)); return; |