From 42906e847dace215e834185b1bcb9aa7c909a478 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Thu, 2 Feb 2023 19:26:04 +0100 Subject: Fix posix version that introduced realpath(NULL) --- hurd/porting/guidelines.mdwn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'hurd/porting') diff --git a/hurd/porting/guidelines.mdwn b/hurd/porting/guidelines.mdwn index d132f516..21c33488 100644 --- a/hurd/porting/guidelines.mdwn +++ b/hurd/porting/guidelines.mdwn @@ -142,10 +142,10 @@ for a potential corresponding `PATH_MAX` macro. They are not a replacement for Note 2: Yes, some POSIX functions such as `realpath()` actually assume that `PATH_MAX` is defined. This is a bug of the POSIX standard, which got fixed in -POSIX 2001, in which one can simply pass `NULL` to get a dynamically +POSIX 2008, in which one can simply pass `NULL` to get a dynamically allocated buffer. One can thus use: - #if _POSIX_VERSION >= 200112 || defined(__GLIBC__) + #if _POSIX_VERSION >= 200809 || defined(__GLIBC__) char *path = realpath(orig, NULL); #else char path[PATH_MATH]; -- cgit v1.2.3