Since 2.3.31, the Linux kernel has allowed an additional 'flags' value for
mremap(): MREMAP_FIXED (defined with the value 2), which serves a similar
purpose to the mmap() MAP_FIXED flag. If this flag is supplied, then mremap()
employs a fifth argument, 'new_address', which specifies a fixed address to
which the mapping should be relocated. Currently, glibc does not expose the
MREMAP_FIXED definition and the mremap() prototype does not expose the fifth
argument. Can these definitions please be exposed in glibc.
I made the necessary changes for several architectures in the CVS trunk.
Unable to compile current snapshot(1017) on MIPS and ALPHA without
# define MREMAP_FIXED 2
added to mman.h to sysdeps/unix/sysv/linux/alpha/bits/mman.h
Will attach patch
Created attachment 719 [details]
Patch to fix REMAP_FIXED not defined error on MIPS and ALPHA
The patch is not needed anymore.
Making mremap() a function with variable number of arguments changes the ABI on
x86_64. Code compiled before this change will treat %rax as scratch. After the
change, the calling conventions expect %al to be set to the number of XMM
Is there a reason why mremap was not versioned after the change?
(In reply to Arun Sharma from comment #5)
> Making mremap() a function with variable number of arguments changes the ABI
> x86_64. Code compiled before this change will treat %rax as scratch. After
> change, the calling conventions expect %al to be set to the number of XMM
> registers passed.
If the called function does not use any floating point registers, this difference is immaterial.