From 64ceb44576e2d4da20dc81754b1b0635aca7392b Mon Sep 17 00:00:00 2001
From: Sergey Fedorov <barracuda@macos-powerpc.org>
Date: Wed, 27 Nov 2024 10:00:04 +0800
Subject: [PATCH] os-wrappers-test: F_DUPFD_CLOEXEC may not be defined

---
 tests/os-wrappers-test.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/os-wrappers-test.c b/tests/os-wrappers-test.c
index 5021859..4efb0ac 100644
--- a/tests/os-wrappers-test.c
+++ b/tests/os-wrappers-test.c
@@ -119,12 +119,16 @@ __attribute__ ((visibility("default"))) int
 
 	wrapped_calls_fcntl++;
 
+#ifdef F_DUPFD_CLOEXEC
 	if (fall_back && (cmd == F_DUPFD_CLOEXEC)) {
 		errno = EINVAL;
 		return -1;
 	}
+#endif
 	switch (cmd) {
+#ifdef F_DUPFD_CLOEXEC
 	case F_DUPFD_CLOEXEC:
+#endif
 	case F_DUPFD:
 	case F_SETFD:
 		va_start(ap, cmd);
