public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix building tst-socket-timestamp-compat on older Linux
@ 2022-02-11 19:16 Tulio Magno Quites Machado Filho
  2022-02-11 19:29 ` Florian Weimer
  0 siblings, 1 reply; 6+ messages in thread
From: Tulio Magno Quites Machado Filho @ 2022-02-11 19:16 UTC (permalink / raw)
  To: libc-alpha

Work around an error caused by not having SO_TIMESTAMP_NEW,
SO_TIMESTAMPNS_NEW, SO_TIMESTAMP_OLD and SO_TIMESTAMPNS_OLD defined.

Tested on ppc64le and x86_64 using Linux 4.16 and 4.18.
---
 .../sysv/linux/tst-socket-timestamp-compat.c    | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/sysdeps/unix/sysv/linux/tst-socket-timestamp-compat.c b/sysdeps/unix/sysv/linux/tst-socket-timestamp-compat.c
index 0ff1a214e6..68b0a0e412 100644
--- a/sysdeps/unix/sysv/linux/tst-socket-timestamp-compat.c
+++ b/sysdeps/unix/sysv/linux/tst-socket-timestamp-compat.c
@@ -23,6 +23,23 @@
 #include <support/xunistd.h>
 #include <stdbool.h>
 
+/* The following macros are only available on ABIs that support 32 bit time_t.
+   This test has a runtime check to guarantee it runs only on these ABIs.
+   However, we need to create fake values to guarantee this test is built
+   for all the ABIs.  */
+#ifndef SO_TIMESTAMP_NEW
+# define SO_TIMESTAMP_NEW 0
+#endif
+#ifndef SO_TIMESTAMPNS_NEW
+# define SO_TIMESTAMPNS_NEW 0
+#endif
+#ifndef SO_TIMESTAMP_OLD
+# define SO_TIMESTAMP_OLD 0
+#endif
+#ifndef SO_TIMESTAMPNS_OLD
+# define SO_TIMESTAMPNS_OLD 0
+#endif
+
 /* AF_INET socket and address used to receive data.  */
 static int srv;
 static struct sockaddr_in srv_addr;
-- 
2.34.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-02-14 13:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-11 19:16 [PATCH] Fix building tst-socket-timestamp-compat on older Linux Tulio Magno Quites Machado Filho
2022-02-11 19:29 ` Florian Weimer
2022-02-11 21:25   ` Tulio Magno Quites Machado Filho
2022-02-11 21:40     ` Florian Weimer
2022-02-14 13:08       ` Adhemerval Zanella
2022-02-14 13:12         ` Adhemerval Zanella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).