]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
posix: Fix attribute access mode on getcwd [BZ #27476]
authorAurelien Jarno <aurelien@aurel32.net>
Fri, 10 Sep 2021 17:39:35 +0000 (19:39 +0200)
committerAurelien Jarno <aurelien@aurel32.net>
Sun, 19 Sep 2021 16:47:28 +0000 (18:47 +0200)
There is a GNU extension that allows to call getcwd(NULL, >0). It is
described in the documentation, but also directly in the unistd.h
header, just above the declaration.

Therefore the attribute access mode added in commit 06febd8c6705
is not correct. Drop it.

(cherry picked from commit 63a788f48a713f2081f200dd054df3e728b0e7c2)

posix/bits/unistd.h
posix/unistd.h

index f0831386c7ddb5744dc764ef38bbc9a741796825..622adeb2b28ed298889ccdcb047a03a724e15cfa 100644 (file)
@@ -199,10 +199,9 @@ __NTH (readlinkat (int __fd, const char *__restrict __path,
 #endif
 
 extern char *__getcwd_chk (char *__buf, size_t __size, size_t __buflen)
-     __THROW __wur __attr_access ((__write_only__, 1, 2));
+     __THROW __wur;
 extern char *__REDIRECT_NTH (__getcwd_alias,
-                            (char *__buf, size_t __size), getcwd)
-  __wur __attr_access ((__write_only__, 1, 2));
+                            (char *__buf, size_t __size), getcwd) __wur;
 extern char *__REDIRECT_NTH (__getcwd_chk_warn,
                             (char *__buf, size_t __size, size_t __buflen),
                             __getcwd_chk)
index 3f2276337944e67a68ea3d02f212a599bfdaded1..bede49c1ff58bc47ea194a4b1b764d398277b72c 100644 (file)
@@ -517,8 +517,7 @@ extern int fchdir (int __fd) __THROW __wur;
    an array is allocated with `malloc'; the array is SIZE
    bytes long, unless SIZE == 0, in which case it is as
    big as necessary.  */
-extern char *getcwd (char *__buf, size_t __size) __THROW __wur
-    __attr_access ((__write_only__, 1, 2));
+extern char *getcwd (char *__buf, size_t __size) __THROW __wur;
 
 #ifdef __USE_GNU
 /* Return a malloc'd string containing the current directory name.