| Bug #95971 | mysql-5-7 needs patch for madvise(void *) | ||
|---|---|---|---|
| Submitted: | 25 Jun 2019 9:00 | Modified: | 12 Jul 2019 16:15 |
| Reporter: | Tor Didriksen | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server: Compiling | Severity: | S3 (Non-critical) |
| Version: | 5.7.28 | OS: | Any |
| Assigned to: | CPU Architecture: | Any | |
[12 Jul 2019 16:15]
Paul DuBois
Posted by developer: Fixed in 5.7.28, 8.0.18. For Solaris, mysqld.cc contained a prototype for memcntl() that is no longer needed. The prototype has been removed.

Description: See SOLARIS bug#29916007 mysql-5-7 contains code that presumes the prototype for the system madvise() function, in mysqld.cc: #if defined(HAVE_SOLARIS_LARGE_PAGES) && defined(__GNUC__) extern "C" int getpagesizes(size_t *, int); extern "C" int memcntl(caddr_t, size_t, int, caddr_t, int, int); #endif This is presumably there because in the past, the <sys/mman.h> headers didn't provide proper C++ declarations. However, that is no longer the case, and the above code causes mysql to fail to build if madvise() gets the modern definition used on Linux. A patch is needed to remove this superfluous code. How to repeat: Read the code. Suggested fix: man memcntl says: #include <sys/types.h> #include <sys/mman.h>