]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Bug 519539 - Darwin shm_open mode is optional and depends on oflag master
authorPaul Floyd <pjfloyd@wanadoo.fr>
Tue, 28 Apr 2026 20:03:22 +0000 (22:03 +0200)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Tue, 28 Apr 2026 20:04:58 +0000 (22:04 +0200)
NEWS
coregrind/m_syswrap/syswrap-darwin.c

diff --git a/NEWS b/NEWS
index 50b8be88baf73319d8ba020dbca0c019b213381f..4967fe770062018350c6af23fc9652ee7d668a45 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -14,7 +14,6 @@ for nanoMIPS/Linux. macOS is supported up to version 13 Ventura (amd64 only).
 
 * ==================== TOOL CHANGES ===================
 
-
 * ==================== FIXED BUGS ====================
 
 The following bugs have been fixed or resolved.  Note that "n-i-bz"
@@ -25,6 +24,7 @@ than mailing the developers (or mailing lists) directly -- bugs that
 are not entered into bugzilla tend to get forgotten about or ignored.
 
 519223  Recognize ioctl(UFFDIO_*) operations
+519539  Darwin shm_open mode is optional and depends on oflag
 
 To see details of a given bug, visit
   https://bugs.kde.org/show_bug.cgi?id=XXXXXX
index 38304712daad80f109ef55cceaa91f6a4dd34c35..b9c7314ec48e2109e28b7e2c2537c9060c3684d6 100644 (file)
@@ -2988,14 +2988,20 @@ PRE(shmget)
 
 PRE(shm_open)
 {
-   PRINT("shm_open(%#lx(%s), %ld, %lu)", ARG1, (HChar *)ARG1, SARG2, ARG3);
-   PRE_REG_READ3(long, "shm_open",
-                 const char *,"name", int,"flags", vki_mode_t,"mode");
+   if (ARG2 & VKI_O_CREAT) {
+      PRINT("shm_open(%#lx(%s), %ld, %lu)", ARG1, (HChar *)ARG1, SARG2, ARG3);
+      PRE_REG_READ3(long, "shm_open",
+                    const char *,"name", int,"flags", vki_mode_t,"mode");
+   } else {
+      PRINT("shm_open(%#lx(%s), %ld)", ARG1, (HChar *)ARG1, SARG2);
+      PRE_REG_READ2(long, "shm_open", const char *,"name", int,"flags");
+   }
 
    PRE_MEM_RASCIIZ( "shm_open(filename)", ARG1 );
 
    *flags |= SfMayBlock;
 }
+
 POST(shm_open)
 {
    vg_assert(SUCCESS);