0b26f7
commit 433ec4f14a5753c7689c83c20c9972915c53c204
0b26f7
Author: Aurelien Jarno <aurelien@aurel32.net>
0b26f7
Date:   Fri Sep 10 19:39:35 2021 +0200
0b26f7
0b26f7
    posix: Fix attribute access mode on getcwd [BZ #27476]
0b26f7
    
0b26f7
    There is a GNU extension that allows to call getcwd(NULL, >0). It is
0b26f7
    described in the documentation, but also directly in the unistd.h
0b26f7
    header, just above the declaration.
0b26f7
    
0b26f7
    Therefore the attribute access mode added in commit 06febd8c6705
0b26f7
    is not correct. Drop it.
0b26f7
0b26f7
diff --git a/posix/bits/unistd.h b/posix/bits/unistd.h
0b26f7
index f0831386c7ddb574..622adeb2b28ed298 100644
0b26f7
--- a/posix/bits/unistd.h
0b26f7
+++ b/posix/bits/unistd.h
0b26f7
@@ -199,10 +199,9 @@ __NTH (readlinkat (int __fd, const char *__restrict __path,
0b26f7
 #endif
0b26f7
 
0b26f7
 extern char *__getcwd_chk (char *__buf, size_t __size, size_t __buflen)
0b26f7
-     __THROW __wur __attr_access ((__write_only__, 1, 2));
0b26f7
+     __THROW __wur;
0b26f7
 extern char *__REDIRECT_NTH (__getcwd_alias,
0b26f7
-			     (char *__buf, size_t __size), getcwd)
0b26f7
-  __wur __attr_access ((__write_only__, 1, 2));
0b26f7
+			     (char *__buf, size_t __size), getcwd) __wur;
0b26f7
 extern char *__REDIRECT_NTH (__getcwd_chk_warn,
0b26f7
 			     (char *__buf, size_t __size, size_t __buflen),
0b26f7
 			     __getcwd_chk)
0b26f7
diff --git a/posix/unistd.h b/posix/unistd.h
0b26f7
index 3dca65732fdde52f..8224c5fbc956306f 100644
0b26f7
--- a/posix/unistd.h
0b26f7
+++ b/posix/unistd.h
0b26f7
@@ -528,8 +528,7 @@ extern int fchdir (int __fd) __THROW __wur;
0b26f7
    an array is allocated with `malloc'; the array is SIZE
0b26f7
    bytes long, unless SIZE == 0, in which case it is as
0b26f7
    big as necessary.  */
0b26f7
-extern char *getcwd (char *__buf, size_t __size) __THROW __wur
0b26f7
-    __attr_access ((__write_only__, 1, 2));
0b26f7
+extern char *getcwd (char *__buf, size_t __size) __THROW __wur;
0b26f7
 
0b26f7
 #ifdef	__USE_GNU
0b26f7
 /* Return a malloc'd string containing the current directory name.