summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lifshitz <dlifshitz@macadamian.com>2016-08-02 16:36:20 -0400
committerDavid Lifshitz <dlifshitz@macadamian.com>2016-08-02 17:21:31 -0400
commit72485ec324e2c11a24ec679e8269c38122e323fc (patch)
tree582171bab76e89900402d9c8d0e6e8315dda3904
parent2ff3fb57364cc240a9fbe9d461d4088d501ea2ad (diff)
downloadATCD-72485ec324e2c11a24ec679e8269c38122e323fc.tar.gz
BZ-4217 Android 6 with 3rd party AIO not working
[Changed] POSIX_Proactor.cpp - disable an OS bounds check for Android since it does not support AIO and ACE_HAS_AIO_CALLS will only be defined if a 3rd party lib is used [Tests] Test 1: 1) Compile ACE for Android using a 3rd party AIO lib 2) In the implementation of ACE_Service_Handler::open, try to read from an ACE_Asynch_Read_Stream 3) Verify it returns >= 0 with no error
-rw-r--r--ACE/ace/POSIX_Proactor.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/ACE/ace/POSIX_Proactor.cpp b/ACE/ace/POSIX_Proactor.cpp
index 4d5105ae03e..0d7f3231b10 100644
--- a/ACE/ace/POSIX_Proactor.cpp
+++ b/ACE/ace/POSIX_Proactor.cpp
@@ -920,6 +920,12 @@ int ACE_POSIX_AIOCB_Proactor::delete_result_aiocb_list (void)
void ACE_POSIX_AIOCB_Proactor::check_max_aio_num ()
{
+#if !defined (ACE_ANDROID)
+ // Android API 23 introduced a define _POSIX_AIO_MAX 1 which gets used by _SC_AIO_MAX.
+ // Previously, without the define, the value returned was -1, which got ignored.
+ // Officially, the Android OS does not support AIO so if ACE_HAS_AIO_CALLS is defined
+ // then a 3rd party library must be in use and this check is invalid.
+
long max_os_aio_num = ACE_OS::sysconf (_SC_AIO_MAX);
// Define max limit AIO's for concrete OS
@@ -929,6 +935,7 @@ void ACE_POSIX_AIOCB_Proactor::check_max_aio_num ()
if (max_os_aio_num > 0 &&
aiocb_list_max_size_ > (unsigned long) max_os_aio_num)
aiocb_list_max_size_ = max_os_aio_num;
+#endif
#if defined (HPUX) || defined (__FreeBSD__)
// Although HPUX 11.00 allows to start 2048 AIO's for all process in