From: Paul Floyd Date: Mon, 9 May 2022 09:58:45 +0000 (+0200) Subject: FreeBSD shm_open2 arg5 seems to be optional X-Git-Tag: VALGRIND_3_20_0~87 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d99b369c094145fd0203fbde59bd6d173b8bc5d0;p=thirdparty%2Fvalgrind.git FreeBSD shm_open2 arg5 seems to be optional This syscall doesn't have a libc interface and manpage so the documentation is skimpy. --- diff --git a/coregrind/m_syswrap/syswrap-freebsd.c b/coregrind/m_syswrap/syswrap-freebsd.c index eed1b5a6da..0f2c2681d3 100644 --- a/coregrind/m_syswrap/syswrap-freebsd.c +++ b/coregrind/m_syswrap/syswrap-freebsd.c @@ -6241,7 +6241,9 @@ PRE(sys_shm_open2) PRE_MEM_RASCIIZ( "shm_open2(path)", ARG1 ); } - PRE_MEM_RASCIIZ( "shm_open2(name)", ARG5 ); + if (ARG5) { + PRE_MEM_RASCIIZ( "shm_open2(name)", ARG5 ); + } *flags |= SfMayBlock; } diff --git a/memcheck/tests/freebsd/scalar_13_plus.c b/memcheck/tests/freebsd/scalar_13_plus.c index a0f5dfe363..4ba48efa60 100644 --- a/memcheck/tests/freebsd/scalar_13_plus.c +++ b/memcheck/tests/freebsd/scalar_13_plus.c @@ -7,7 +7,7 @@ int main(void) /* SYS_shm_open2 571 */ GO(SYS_shm_open2, " 5s 2m"); - SY(SYS_shm_open2, x0, x0+1, x0+2, x0+3, x0); FAIL; + SY(SYS_shm_open2, x0, x0+1, x0+2, x0+3, x0+4); FAIL; /* SYS___realpathat 574 */ GO(SYS___realpathat, " 5s 2m");