3838#include " Utils.h"
3939#include " binder_module.h"
4040
41+ #if (defined(__ANDROID__) || defined(__Fuchsia__)) && !defined(BINDER_WITH_KERNEL_IPC)
42+ #error Android and Fuchsia are expected to have BINDER_WITH_KERNEL_IPC
43+ #endif
44+
4145#if LOG_NDEBUG
4246
4347#define IF_LOG_TRANSACTIONS () if (false )
@@ -1229,7 +1233,7 @@ status_t IPCThreadState::talkWithDriver(bool doReceive)
12291233 std::string message = logStream.str ();
12301234 ALOGI (" %s" , message.c_str ());
12311235 }
1232- #if defined(__ANDROID__ )
1236+ #if defined(BINDER_WITH_KERNEL_IPC )
12331237 if (ioctl (mProcess ->mDriverFD , BINDER_WRITE_READ, &bwr) >= 0 )
12341238 err = NO_ERROR;
12351239 else
@@ -1625,7 +1629,7 @@ void IPCThreadState::threadDestructor(void *st)
16251629 IPCThreadState* const self = static_cast <IPCThreadState*>(st);
16261630 if (self) {
16271631 self->flushCommands ();
1628- #if defined(__ANDROID__ )
1632+ #if defined(BINDER_WITH_KERNEL_IPC )
16291633 if (self->mProcess ->mDriverFD >= 0 ) {
16301634 ioctl (self->mProcess ->mDriverFD , BINDER_THREAD_EXIT, 0 );
16311635 }
@@ -1641,7 +1645,7 @@ status_t IPCThreadState::getProcessFreezeInfo(pid_t pid, uint32_t *sync_received
16411645 binder_frozen_status_info info = {};
16421646 info.pid = pid;
16431647
1644- #if defined(__ANDROID__ )
1648+ #if defined(BINDER_WITH_KERNEL_IPC )
16451649 if (ioctl (self ()->mProcess ->mDriverFD , BINDER_GET_FROZEN_INFO, &info) < 0 )
16461650 ret = -errno;
16471651#endif
@@ -1660,7 +1664,7 @@ status_t IPCThreadState::freeze(pid_t pid, bool enable, uint32_t timeout_ms) {
16601664 info.timeout_ms = timeout_ms;
16611665
16621666
1663- #if defined(__ANDROID__ )
1667+ #if defined(BINDER_WITH_KERNEL_IPC )
16641668 if (ioctl (self ()->mProcess ->mDriverFD , BINDER_FREEZE, &info) < 0 )
16651669 ret = -errno;
16661670#endif
@@ -1678,7 +1682,7 @@ void IPCThreadState::logExtendedError() {
16781682 if (!ProcessState::isDriverFeatureEnabled (ProcessState::DriverFeature::EXTENDED_ERROR))
16791683 return ;
16801684
1681- #if defined(__ANDROID__ )
1685+ #if defined(BINDER_WITH_KERNEL_IPC )
16821686 if (ioctl (self ()->mProcess ->mDriverFD , BINDER_GET_EXTENDED_ERROR, &ee) < 0 ) {
16831687 ALOGE (" Failed to get extended error: %s" , strerror (errno));
16841688 return ;
0 commit comments