From c47d49ef7e63046a6f60aefef5ff2eedeb3c2458 Mon Sep 17 00:00:00 2001
From: Ismael Luceno <ismael@iodev.co.uk>
Date: Sat, 19 Sep 2026 05:58:53 +0200
Subject: [PATCH 11/12] Use the POSIX spellings <poll.h> and <fcntl.h>

<sys/poll.h> and <sys/fcntl.h> are pre-POSIX spellings.  musl keeps them
only as compatibility shims that emit

  #warning redirecting incorrect #include <sys/poll.h> to <poll.h>

which -Werror turns into a build failure -- for every staprun object
file, and for stapbpf.  The POSIX headers <poll.h> and <fcntl.h> have
been the right spelling everywhere for decades, glibc included.

Upstream-Status: Pending
Signed-off-by: Ismael Luceno <ismael@sourcemage.org>
---
 stapbpf/stapbpf.cxx | 2 +-
 staprun/staprun.h   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/stapbpf/stapbpf.cxx b/stapbpf/stapbpf.cxx
index 4991c136..773b6693 100644
--- a/stapbpf/stapbpf.cxx
+++ b/stapbpf/stapbpf.cxx
@@ -34,7 +34,7 @@
 #include <limits.h>
 #include <inttypes.h>
 #include <getopt.h>
-#include <sys/fcntl.h>
+#include <fcntl.h>
 #include <sys/ioctl.h>
 #include <sys/stat.h>
 #include <sys/syscall.h>
diff --git a/staprun/staprun.h b/staprun/staprun.h
index db24e1f2..bcf7ea75 100644
--- a/staprun/staprun.h
+++ b/staprun/staprun.h
@@ -30,7 +30,7 @@
 #include <errno.h>
 #include <linux/fd.h>
 #include <sys/mman.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <pthread.h>
 #include <sys/socket.h>
 #include <linux/limits.h>
@@ -234,7 +234,7 @@ int insert_module(const char *path, const char *special_options,
 		  privilege_t *user_credentials
 );
 
-int rename_module(void* module_file, const __off_t st_size);
+int rename_module(void* module_file, const off_t st_size);
 
 int mountfs(void);
 void start_symbol_thread(void);
