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

Message ID 319854d0-fb79-d6d5-dcec-4b6d1c2c2fed@t-online.de
State New
Headers
Series unistd.h: enable SEEK_DATA and SEEK_HOLE also for POSIX-1.2024 |

Commit Message

Christian Franke Feb. 14, 2025, 1:57 p.m. UTC
  SEEK_DATA and SEEK_HOLE are no longer GNU extensions only.
  

Comments

Joel Sherrill Feb. 14, 2025, 2:53 p.m. UTC | #1
This looks good to me.

--joel

On Fri, Feb 14, 2025 at 7:58 AM Christian Franke <
Christian.Franke@t-online.de> wrote:

> SEEK_DATA and SEEK_HOLE are no longer GNU extensions only.
>
> --
> Regards,
> Christian
>
>
  
Corinna Vinschen Feb. 14, 2025, 2:58 p.m. UTC | #2
On Feb 14 14:57, Christian Franke wrote:
> 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(-)

Pushed.

Thanks,
Corinna
  

Patch

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