https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=b921a5fb8706d21efe9723b27ada290f1bba946e
commit b921a5fb8706d21efe9723b27ada290f1bba946e
Author: Paul Floyd <pj...@wa...>
Date: Thu Apr 17 21:54:43 2025 +0200
FreeBSD: increase coverage of --modify-mds syscalls
As illumos, still missing a couple.
Diff:
---
coregrind/m_syswrap/syswrap-freebsd.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/coregrind/m_syswrap/syswrap-freebsd.c b/coregrind/m_syswrap/syswrap-freebsd.c
index 12b18f4e6e..7ea04fdbc6 100644
--- a/coregrind/m_syswrap/syswrap-freebsd.c
+++ b/coregrind/m_syswrap/syswrap-freebsd.c
@@ -1410,6 +1410,7 @@ POST(sys_fcntl)
{
vg_assert(SUCCESS);
if (ARG2 == VKI_F_DUPFD) {
+ POST_newFd_RES;
if (!ML_(fd_allowed)(RES, "fcntl(DUPFD)", tid, True)) {
VG_(close)(RES);
SET_STATUS_Failure( VKI_EMFILE );
@@ -1419,6 +1420,7 @@ POST(sys_fcntl)
}
}
} else if (ARG2 == VKI_F_DUPFD_CLOEXEC) {
+ POST_newFd_RES;
if (!ML_(fd_allowed)(RES, "fcntl(DUPFD_CLOEXEC)", tid, True)) {
VG_(close)(RES);
SET_STATUS_Failure( VKI_EMFILE );
@@ -2728,6 +2730,7 @@ PRE(sys_fhopen)
POST(sys_fhopen)
{
vg_assert(SUCCESS);
+ POST_newFd_RES;
if (!ML_(fd_allowed)(RES, "fhopen", tid, True)) {
VG_(close)(RES);
SET_STATUS_Failure( VKI_EMFILE );
@@ -3537,6 +3540,7 @@ PRE(sys_kqueue)
POST(sys_kqueue)
{
+ POST_newFd_RES;
if (!ML_(fd_allowed)(RES, "kqueue", tid, True)) {
VG_(close)(RES);
SET_STATUS_Failure( VKI_EMFILE );
@@ -4701,6 +4705,7 @@ PRE(sys_kmq_open)
POST(sys_kmq_open)
{
vg_assert(SUCCESS);
+ POST_newFd_RES;
if (!ML_(fd_allowed)(RES, "mq_open", tid, True)) {
VG_(close)(RES);
SET_STATUS_Failure( VKI_EMFILE );
@@ -5052,6 +5057,7 @@ PRE(sys_shm_open)
POST(sys_shm_open)
{
vg_assert(SUCCESS);
+ POST_newFd_RES;
if (!ML_(fd_allowed)(RES, "shm_open", tid, True)) {
VG_(close)(RES);
SET_STATUS_Failure( VKI_EMFILE );
@@ -6564,6 +6570,7 @@ PRE(sys_shm_open2)
POST(sys_shm_open2)
{
vg_assert(SUCCESS);
+ POST_newFd_RES;
if (!ML_(fd_allowed)(RES, "shm_open2", tid, True)) {
VG_(close)(RES);
SET_STATUS_Failure( VKI_EMFILE );
@@ -6825,6 +6832,7 @@ PRE(sys_kqueuex)
POST(sys_kqueuex)
{
+ POST_newFd_RES;
if (!ML_(fd_allowed)(RES, "kqueuex", tid, True)) {
VG_(close)(RES);
SET_STATUS_Failure(VKI_EMFILE);
@@ -6857,6 +6865,7 @@ PRE(sys_timerfd_create)
POST(sys_timerfd_create)
{
+ POST_newFd_RES;
if (!ML_(fd_allowed)(RES, "timerfd_create", tid, True)) {
VG_(close)(RES);
SET_STATUS_Failure( VKI_EMFILE );
|