MoonchildProductions#1251 - Part 10: should use IOV_MAX.

I assess this change to be low-risk for the following reasons:

1. It has been in Firefox since version 55 without issues.

2. The current behavior is not POSIX compliant, and is retained in the one instance where the new functionality causes issues.

3. It makes safer assumptions about implementation details than what we have now.
athenian200 3 years ago committed by Roy Tam
parent 7de03715a5
commit 9df21e3a0e
  1. 11

@ -8,6 +8,7 @@
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#if defined(OS_MACOSX)
#include <sched.h>
@ -39,8 +40,16 @@
#include "mozilla/ipc/Faulty.h"
// Work around possible OS limitations.
// Use OS specific iovec array limit where it's possible
#if defined(IOV_MAX)
static const size_t kMaxIOVecSize = IOV_MAX;
// IOV_MAX isn't defined on Android, but the hard-coded 256 works well.
#elif defined(ANDROID)
static const size_t kMaxIOVecSize = 256;
// On all other platforms, fallback to 16 (_XOPEN_IOV_MAX) as a safe bet.
static const size_t kMaxIOVecSize = 16;
#include "GeckoTaskTracerImpl.h"