Skip to contentSkip to conversation

selftests/filesystems: include fcntl.h in fclog

PATCH RESEND In review Arthur Cassegrain 1 participant 2 messages Sep 10 Kselftest

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 selftests/filesystems: include fcntl.h in fclog

fclog.c uses open(), O_RDONLY, O_CLOEXEC and AT_FDCWD, but it does not include <fcntl.h>, where they are declared or defined.

This was hidden while <sys/mount.h> pulled in <fcntl.h> indirectly. glibc stopped providing that transitive include in [1], which exposes the missing direct dependency.

Include <fcntl.h> explicitly so fclog.c builds with glibc 2.44 development headers.

[1] glibc -- change 419245719ccb ("include: isolate __O_CLOEXEC flag for sys/mount.h and fcntl.h")

Fixes df579e471111 ("selftests/filesystems: add basic fscontext log tests")
---
 tools/testing/selftests/filesystems/fclog.c | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/filesystems/fclog.c +1 -0
index 551c4a0f395a..df0767a7e01d 100644
@@ -6,6 +6,7 @@
 
 #include <assert.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <sched.h>
 #include <stdio.h>
 #include <stdlib.h>

---
base-commit: 0e35b9b6ec0ffcc5e23cbdec09f5c622ad532b53
change-id: 20260707-fclog-fix-include-ef30967e9359

Best regards,
--
Arthur Cassegrain <[email protected]>

Signature · 1 line
Arthur Cassegrain <[email protected]>
#1 lore raw
Quoted 12 lines

fclog.c uses open(), O_RDONLY, O_CLOEXEC and AT_FDCWD, but it does not include <fcntl.h>, where they are declared or defined.

This was hidden while <sys/mount.h> pulled in <fcntl.h> indirectly. glibc stopped providing that transitive include in [1], which exposes the missing direct dependency.

Include <fcntl.h> explicitly so fclog.c builds with glibc 2.44 development headers.

[1] glibc -- change 419245719ccb ("include: isolate __O_CLOEXEC flag for sys/mount.h and fcntl.h")

Quoted 7 lines
Fixes df579e471111 ("selftests/filesystems: add basic fscontext log tests")

---

Sorry, I just realized that this fix has already been merged:
https://lore.kernel.org/all/[email protected]/

Please ignore this resend.

Thanks,
Arthur