Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

preload: Re-fix time64 redirects for glibc < 2.39.9 #243

Merged
merged 1 commit into from
May 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/libumockdev-preload.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ extern int __REDIRECT_NTH (__ttyname_r_alias, (int __fd, char *__buf,
#include "ioctl_tree.h"

#ifdef __GLIBC__

/* __USE_TIME64_REDIRECTS was introduced in glibc 2.39.9. With older releases we need to look at
* __USE_TIME_BITS64 instead, but the latter is always defined in 2.39.9 now. So make some guesswork
* and define the former when appropriate. */
#if !defined(__USE_TIME64_REDIRECTS) && defined(__USE_TIME_BITS64) && __TIMESIZE == 32
#pragma message "Defining backwards compatibility shim __USE_TIME64_REDIRECTS for glibc < 2.39.9"
#define __USE_TIME64_REDIRECTS 1
#endif

/* Fixup for making a mess with __REDIRECT above */
#ifdef __USE_TIME64_REDIRECTS
#define clock_gettime __clock_gettime64
Expand Down