]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Bug 477630 - Include ucontext.h rather than sys/ucontext.h in Solaris sources
authorPaul Floyd <pjfloyd@wanadoo.fr>
Tue, 28 Nov 2023 07:00:19 +0000 (08:00 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Tue, 28 Nov 2023 07:00:19 +0000 (08:00 +0100)
Patch provided by
   Jakub Kulik kulikjak@gmail.com

NEWS
coregrind/m_aspacemgr/aspacemgr-common.c
coregrind/m_syswrap/syswrap-solaris.c
include/vki/vki-scnums-solaris.h
include/vki/vki-solaris.h

diff --git a/NEWS b/NEWS
index 714f9acc5b67efe24c90f4475e783493e8585997..fd581163bca3666ae16550b282932a5ccbb8474f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -42,6 +42,7 @@ are not entered into bugzilla tend to get forgotten about or ignored.
 476787  Build of Valgrind 3.21.0 fails when SOLARIS_PT_SUNDWTRACE_THRP is
         defined
 476887  WARNING: unhandled amd64-freebsd syscall: 578
+477630  Include ucontext.h rather than sys/ucontext.h in Solaris sources
 
 To see details of a given bug, visit
   https://bugs.kde.org/show_bug.cgi?id=XXXXXX
index 816d2274f464c920f3dac6b22c76e9e209ac97d6..7ad1b40acfa3c6db132bf3eed2fc816ffb61c949 100644 (file)
@@ -223,7 +223,7 @@ SysRes ML_(am_do_extend_mapping_NO_NOTIFY)(
    /* Extend the mapping old_addr .. old_addr+old_len-1 to have length
       new_len, WITHOUT moving it.  If it can't be extended in place,
       fail. */
-#  if defined(VGO_linux)
+#  if defined(VGO_linux) || defined(VGO_solaris)
    return VG_(do_syscall5)(
              __NR_mremap, 
              old_addr, old_len, new_len, 
@@ -244,7 +244,7 @@ SysRes ML_(am_do_relocate_nooverlap_mapping_NO_NOTIFY)(
       location and with the new length.  Only needs to handle the case
       where the two areas do not overlap, neither length is zero, and
       all args are page aligned. */
-#  if defined(VGO_linux)
+#  if defined(VGO_linux) || defined(VGO_solaris)
    return VG_(do_syscall5)(
              __NR_mremap, 
              old_addr, old_len, new_len, 
index b5489644c126ba8575ad86bbfb669a745bd5849c..5bd04984914364935848331cacad42e1a5639a63 100644 (file)
@@ -10953,6 +10953,9 @@ static SyscallTableEntry syscall_table[] = {
 #if defined(SOLARIS_UUIDSYS_SYSCALL)
    SOLXY(__NR_uuidsys,              sys_uuidsys),               /* 124 */
 #endif /* SOLARIS_UUIDSYS_SYSCALL */
+#if defined(HAVE_MREMAP)
+   GENX_(__NR_mremap,               sys_mremap),                /* 126 */
+#endif /* HAVE_MREMAP */
    SOLX_(__NR_mmapobj,              sys_mmapobj),               /* 127 */
    GENX_(__NR_setrlimit,            sys_setrlimit),             /* 128 */
    GENXY(__NR_getrlimit,            sys_getrlimit),             /* 129 */
index 99388091a8137323efc8ea60c7d39518c9baa302..25bde39d84aebbd649163866da03d007d9483664 100644 (file)
@@ -33,6 +33,8 @@
 #ifndef __VKI_SCNUMS_SOLARIS_H
 #define __VKI_SCNUMS_SOLARIS_H
 
+#include "config.h"
+
 /* Note: Basic information about Solaris syscalls can be found in the kernel
    source file uts/common/os/sysent.c.
  */
 #if defined(SOLARIS_UUIDSYS_SYSCALL)
 #define __NR_uuidsys                    SYS_uuidsys
 #endif /* SOLARIS_UUIDSYS_SYSCALL */
+#if defined(HAVE_MREMAP)
+#define __NR_mremap                     SYS_mremap
+#endif /* HAVE_MREMAP */
 #define __NR_mmapobj                    SYS_mmapobj
 #define __NR_setrlimit                  SYS_setrlimit
 #define __NR_getrlimit                  SYS_getrlimit
index 9fdf53c4191105a304db56f79516c725cddb2b6e..c0e950bbd9806f66d61bb8c391489544965fa012 100644 (file)
@@ -663,6 +663,11 @@ typedef struct vki_kcf_door_arg_s {
 
 #define vki_meminfo_t meminfo_t
 
+#if defined(HAVE_MREMAP)
+#define VKI_MREMAP_FIXED MREMAP_FIXED
+#define VKI_MREMAP_MAYMOVE MREMAP_MAYMOVE
+#endif /* HAVE_MREMAP */
+
 
 #include <sys/mntio.h>
 #define VKI_MNTIOC_GETEXTMNTENT MNTIOC_GETEXTMNTENT