[PATCH] unistd.h: enable SEEK_DATA and SEEK_HOLE also for POSIX-1.2024

Christian Franke Christian.Franke@t-online.de
Fri Feb 14 13:57:14 GMT 2025


SEEK_DATA and SEEK_HOLE are no longer GNU extensions only.

-- 
Regards,
Christian

-------------- next part --------------
From 0d68f316bf66188b0109b6e3325da8672c6da386 Mon Sep 17 00:00:00 2001
From: Christian Franke <christian.franke@t-online.de>
Date: Fri, 14 Feb 2025 14:39:23 +0100
Subject: [PATCH] unistd.h: enable SEEK_DATA and SEEK_HOLE also for
 POSIX-1.2024

https://pubs.opengroup.org/onlinepubs/9799919799/functions/lseek.html

Signed-off-by: Christian Franke <christian.franke@t-online.de>
---
 newlib/libc/include/sys/unistd.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/newlib/libc/include/sys/unistd.h b/newlib/libc/include/sys/unistd.h
index 9dae4b373..e62e38d10 100644
--- a/newlib/libc/include/sys/unistd.h
+++ b/newlib/libc/include/sys/unistd.h
@@ -333,7 +333,7 @@ int	unlinkat (int, const char *, int);
 # define	SEEK_SET	0
 # define	SEEK_CUR	1
 # define	SEEK_END	2
-#if __GNU_VISIBLE
+#if __GNU_VISIBLE || __POSIX_VISIBLE >= 202405
 # define	SEEK_DATA	3
 # define	SEEK_HOLE	4
 #endif
-- 
2.45.1



More information about the Newlib mailing list