diff mbox series

[2/4] testsuite: add function declarations for __xstat family

Message ID 20230206140449.574631-3-emil.l.velikov@gmail.com (mailing list archive)
State New, archived
Headers show
Series kmod: Various papercuts | expand

Commit Message

Emil Velikov Feb. 6, 2023, 2:04 p.m. UTC
From: Emil Velikov <emil.velikov@collabora.com>

As the inline comment says - the declarations have been dropped with
glibc 2.32.9000, as a result the build throws a set of lovely warnings.

Inspired by umockdev, which bears the same license as this project.
https://github.com/martinpitt/umockdev/commit/f1b416400479d861deffb4c5a40422dcdf190e85

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
---
 testsuite/path.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comments

Lucas De Marchi Feb. 8, 2023, 10:11 p.m. UTC | #1
On Mon, Feb 06, 2023 at 02:04:47PM +0000, Emil Velikov wrote:
>From: Emil Velikov <emil.velikov@collabora.com>
>
>As the inline comment says - the declarations have been dropped with
>glibc 2.32.9000, as a result the build throws a set of lovely warnings.
>
>Inspired by umockdev, which bears the same license as this project.
>https://github.com/martinpitt/umockdev/commit/f1b416400479d861deffb4c5a40422dcdf190e85

nice. I was thinking "how come the names are so similar to what I
*think* I coded 10+ years ago? It turns out kmod's implementation was
used as inspiration for the umockdev :)

https://github.com/martinpitt/umockdev/commit/30e9d689181ee1cdea30933eef537b5b805d678f


Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>


thanks
Lucas De Marchi

>
>Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
>---
> testsuite/path.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
>diff --git a/testsuite/path.c b/testsuite/path.c
>index c1ae498..5a291b1 100644
>--- a/testsuite/path.c
>+++ b/testsuite/path.c
>@@ -163,8 +163,15 @@ TS_EXPORT int open ## suffix (const char *path, int flags, ...)	\
> 	return _fn(p, flags);					\
> }
>
>-/* wrapper template for __xstat family */
>+/*
>+ * wrapper template for __xstat family
>+ * This family got deprecated/dropped in glibc 2.32.9000, but we still need
>+ * to keep it for a while for programs that were built against previous versions
>+ */
> #define WRAP_VERSTAT(prefix, suffix)			    \
>+TS_EXPORT int prefix ## stat ## suffix (int ver,	    \
>+			      const char *path,		    \
>+	                      struct stat ## suffix *st);   \
> TS_EXPORT int prefix ## stat ## suffix (int ver,	    \
> 			      const char *path,		    \
> 	                      struct stat ## suffix *st)    \
>-- 
>2.39.1
>
diff mbox series

Patch

diff --git a/testsuite/path.c b/testsuite/path.c
index c1ae498..5a291b1 100644
--- a/testsuite/path.c
+++ b/testsuite/path.c
@@ -163,8 +163,15 @@  TS_EXPORT int open ## suffix (const char *path, int flags, ...)	\
 	return _fn(p, flags);					\
 }
 
-/* wrapper template for __xstat family */
+/*
+ * wrapper template for __xstat family
+ * This family got deprecated/dropped in glibc 2.32.9000, but we still need
+ * to keep it for a while for programs that were built against previous versions
+ */
 #define WRAP_VERSTAT(prefix, suffix)			    \
+TS_EXPORT int prefix ## stat ## suffix (int ver,	    \
+			      const char *path,		    \
+	                      struct stat ## suffix *st);   \
 TS_EXPORT int prefix ## stat ## suffix (int ver,	    \
 			      const char *path,		    \
 	                      struct stat ## suffix *st)    \