summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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