Bug #54662 HAVE_MLOCK never set by configure, and if set breaks compilation
Submitted: 21 Jun 2010 10:27 Modified: 14 Jan 2013 16:19
Reporter: Kent Boortz Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: CPU Architecture:Any
Tags: SEAGULL
Triage: Triaged: D4 (Minor)

[21 Jun 2010 10:27] Kent Boortz
Description:
There is no configure test for the function "mlock", and then HAVE_MLOCK is never set, in effect disabling the code in "mysys/my_lockmem.c" for all builds.

If adding the test, the compilation will fail, as the function declaration and definition doesn't match, comparing "include/my_sys.h" with "mysys/my_lockmem.c" and the function my_malloc_lock(), first argument declared being 'size_t' vs defined as 'uint'.

How to repeat:
Compile from source adding "mlock" to the configure test, search for mlockall in "configure.in" and add it there. Most Linux platforms would then define HAVE_MLOCK.
[21 Jun 2010 13:35] Davi Arnaut
Suggested fix: remove the code under HAVE_MLOCK. Is there any reason to keep it?
[14 Jan 2013 16:19] Paul Dubois
Noted in 5.7.1 changelog.

Source code in the mysys library for the my_malloc_lock and 
my_free_lock memory-locking APIs was never used and has been removed.