From 6ee1b1498e409b5494a6bbedfd143105380edbac Mon Sep 17 00:00:00 2001
From: Laurent Bercot <ska-devel@skarnet.org>
Date: Tue, 16 Feb 2021 18:46:10 +0100
Subject: [PATCH] Disable wrapping of ppoll

The fortify-headers/poll.h definitions incorrectly forward the ppoll()
function: on some archs (armv7 for instance), musl renames the symbol to
accommodate for time_t size, and fortify-headers misses that.

This causes ppoll() to break on all time32 systems.  This commit axes
the ppoll() redefinition. Fortifying ppoll() is of very little benefit
anyway.
---
 README         |  1 -
 include/poll.h | 13 -------------
 2 files changed, 14 deletions(-)

diff --git a/README b/README
index 7e9c111..f620a47 100644
--- a/README
+++ b/README
@@ -67,7 +67,6 @@ memmove
 mempcpy
 memset
 poll
-ppoll
 pread
 read
 readlink
diff --git a/include/poll.h b/include/poll.h
index b8d5c0b..04f28cb 100644
--- a/include/poll.h
+++ b/include/poll.h
@@ -40,19 +40,6 @@ _FORTIFY_FN(poll) int poll(struct pollfd * _FORTIFY_POS0 __f, nfds_t __n, int __
 	return __orig_poll(__f, __n, __s);
 }
 
-#ifdef _GNU_SOURCE
-#undef ppoll
-_FORTIFY_FN(ppoll) int ppoll(struct pollfd * _FORTIFY_POS0 __f, nfds_t __n,
-                             const struct timespec *__s, const sigset_t *__m)
-{
-	__typeof__(sizeof 0) __b = __builtin_object_size(__f, 0);
-
-	if (__n > __b / sizeof(struct pollfd))
-		__builtin_trap();
-	return __orig_ppoll(__f, __n, __s, __m);
-}
-#endif
-
 #ifdef __cplusplus
 }
 #endif
