about summary refs log tree commit diff
path: root/posix/bits
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@sourceware.org>2022-01-12 23:34:48 +0530
committerSiddhesh Poyarekar <siddhesh@sourceware.org>2022-01-12 23:34:48 +0530
commitfcfc9086815bf0d277ad47a90ee3fda4c37acca8 (patch)
tree0b00baceb19165a006457ad9a65c7e6478dc3f47 /posix/bits
parentdb27f1251b008280a29d540b4f8ab2a38a0d80af (diff)
downloadglibc-fcfc9086815bf0d277ad47a90ee3fda4c37acca8.tar.gz
glibc-fcfc9086815bf0d277ad47a90ee3fda4c37acca8.tar.xz
glibc-fcfc9086815bf0d277ad47a90ee3fda4c37acca8.zip
debug: Synchronize feature guards in fortified functions [BZ #28746]
Some functions (e.g. stpcpy, pread64, etc.) had moved to POSIX in the
main headers as they got incorporated into the standard, but their
fortified variants remained under __USE_GNU.  As a result, these
functions did not get fortified when _GNU_SOURCE was not defined.

Add test wrappers that check all functions tested in tst-chk0 at all
levels with _GNU_SOURCE undefined and then use the failures to (1)
exclude checks for _GNU_SOURCE functions in these tests and (2) Fix
feature macro guards in the fortified function headers so that they're
the same as the ones in the main headers.

This fixes BZ #28746.

Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
Diffstat (limited to 'posix/bits')
-rw-r--r--posix/bits/unistd.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/posix/bits/unistd.h b/posix/bits/unistd.h
index 01df84b5f9..f53a7a06eb 100644
--- a/posix/bits/unistd.h
+++ b/posix/bits/unistd.h
@@ -40,7 +40,7 @@ read (int __fd, void *__buf, size_t __nbytes)
 			  __fd, __buf, __nbytes);
 }
 
-#ifdef __USE_UNIX98
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K8
 extern ssize_t __pread_chk (int __fd, void *__buf, size_t __nbytes,
 			    __off_t __offset, size_t __bufsize)
   __wur __attr_access ((__write_only__, 2, 3));