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 )
@@ -1215,7 +1219,7 @@ status_t IPCThreadState::talkWithDriver(bool doReceive)
12151219 std::string message = logStream.str ();
12161220 ALOGI (" %s" , message.c_str ());
12171221 }
1218- #if defined(__ANDROID__ )
1222+ #if defined(BINDER_WITH_KERNEL_IPC )
12191223 if (ioctl (mProcess ->mDriverFD , BINDER_WRITE_READ, &bwr) >= 0 )
12201224 err = NO_ERROR;
12211225 else
@@ -1604,7 +1608,7 @@ void IPCThreadState::threadDestructor(void *st)
16041608 IPCThreadState* const self = static_cast <IPCThreadState*>(st);
16051609 if (self) {
16061610 self->flushCommands ();
1607- #if defined(__ANDROID__ )
1611+ #if defined(BINDER_WITH_KERNEL_IPC )
16081612 if (self->mProcess ->mDriverFD >= 0 ) {
16091613 ioctl (self->mProcess ->mDriverFD , BINDER_THREAD_EXIT, 0 );
16101614 }
@@ -1620,7 +1624,7 @@ status_t IPCThreadState::getProcessFreezeInfo(pid_t pid, uint32_t *sync_received
16201624 binder_frozen_status_info info = {};
16211625 info.pid = pid;
16221626
1623- #if defined(__ANDROID__ )
1627+ #if defined(BINDER_WITH_KERNEL_IPC )
16241628 if (ioctl (self ()->mProcess ->mDriverFD , BINDER_GET_FROZEN_INFO, &info) < 0 )
16251629 ret = -errno;
16261630#endif
@@ -1639,7 +1643,7 @@ status_t IPCThreadState::freeze(pid_t pid, bool enable, uint32_t timeout_ms) {
16391643 info.timeout_ms = timeout_ms;
16401644
16411645
1642- #if defined(__ANDROID__ )
1646+ #if defined(BINDER_WITH_KERNEL_IPC )
16431647 if (ioctl (self ()->mProcess ->mDriverFD , BINDER_FREEZE, &info) < 0 )
16441648 ret = -errno;
16451649#endif
@@ -1657,7 +1661,7 @@ void IPCThreadState::logExtendedError() {
16571661 if (!ProcessState::isDriverFeatureEnabled (ProcessState::DriverFeature::EXTENDED_ERROR))
16581662 return ;
16591663
1660- #if defined(__ANDROID__ )
1664+ #if defined(BINDER_WITH_KERNEL_IPC )
16611665 if (ioctl (self ()->mProcess ->mDriverFD , BINDER_GET_EXTENDED_ERROR, &ee) < 0 ) {
16621666 ALOGE (" Failed to get extended error: %s" , strerror (errno));
16631667 return ;
0 commit comments