1 Add support for new mremap syscall.
3 This can be offered upstream.
5 --- valgrind-3.22.0/coregrind/m_aspacemgr/aspacemgr-common.c
6 +++ valgrind-3.22.0/coregrind/m_aspacemgr/aspacemgr-common.c
7 @@ -223,7 +223,7 @@ SysRes ML_(am_do_extend_mapping_NO_NOTIF
8 /* Extend the mapping old_addr .. old_addr+old_len-1 to have length
9 new_len, WITHOUT moving it. If it can't be extended in place,
11 -# if defined(VGO_linux)
12 +# if defined(VGO_linux) || defined(VGO_solaris)
13 return VG_(do_syscall5)(
15 old_addr, old_len, new_len,
16 @@ -244,7 +244,7 @@ SysRes ML_(am_do_relocate_nooverlap_mapp
17 location and with the new length. Only needs to handle the case
18 where the two areas do not overlap, neither length is zero, and
19 all args are page aligned. */
20 -# if defined(VGO_linux)
21 +# if defined(VGO_linux) || defined(VGO_solaris)
22 return VG_(do_syscall5)(
24 old_addr, old_len, new_len,
25 --- valgrind-3.22.0/include/vki/vki-solaris.h
26 +++ valgrind-3.22.0/include/vki/vki-solaris.h
27 @@ -664,6 +664,11 @@ typedef struct vki_kcf_door_arg_s {
28 #define vki_meminfo_t meminfo_t
31 +#include <sys/mman.h>
32 +#define VKI_MREMAP_FIXED MREMAP_FIXED
33 +#define VKI_MREMAP_MAYMOVE MREMAP_MAYMOVE
36 #include <sys/mntio.h>
37 #define VKI_MNTIOC_GETEXTMNTENT MNTIOC_GETEXTMNTENT
38 #define VKI_MNTIOC_GETMNTANY MNTIOC_GETMNTANY
39 --- valgrind-3.22.0/include/vki/vki-scnums-solaris.h
40 +++ valgrind-3.22.0/include/vki/vki-scnums-solaris.h
42 #if defined(SOLARIS_UUIDSYS_SYSCALL)
43 #define __NR_uuidsys SYS_uuidsys
44 #endif /* SOLARIS_UUIDSYS_SYSCALL */
45 +#define __NR_mremap SYS_mremap
46 #define __NR_mmapobj SYS_mmapobj
47 #define __NR_setrlimit SYS_setrlimit
48 #define __NR_getrlimit SYS_getrlimit
49 --- valgrind-3.21.0/coregrind/m_syswrap/syswrap-solaris.c
50 +++ valgrind-3.21.0/coregrind/m_syswrap/syswrap-solaris.c
51 @@ -10951,6 +10951,9 @@ static SyscallTableEntry syscall_table[]
52 #if defined(SOLARIS_UUIDSYS_SYSCALL)
53 SOLXY(__NR_uuidsys, sys_uuidsys), /* 124 */
54 #endif /* SOLARIS_UUIDSYS_SYSCALL */
55 +#if defined(HAVE_MREMAP)
56 + GENX_(__NR_mremap, sys_mremap), /* 126 */
57 +#endif /* HAVE_MREMAP */
58 SOLX_(__NR_mmapobj, sys_mmapobj), /* 127 */
59 GENX_(__NR_setrlimit, sys_setrlimit), /* 128 */
60 GENXY(__NR_getrlimit, sys_getrlimit), /* 129 */