summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-12-10 22:11:07 +0100
committerThomas Haller <thaller@redhat.com>2020-12-23 10:48:26 +0100
commit44e25bbb961d17508c91fd195563ec670a8e337c (patch)
tree8bf56fc065130db03ab9b25e14927abcea01713b
parent2f9238b987756f101134e35c44bc54b69e0392d7 (diff)
downloadNetworkManager-44e25bbb961d17508c91fd195563ec670a8e337c.tar.gz
systemd: use pthread instead of internal glibc functionality on non glibc platform
-rw-r--r--shared/systemd/sd-adapt-shared/nm-sd-adapt-shared.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/shared/systemd/sd-adapt-shared/nm-sd-adapt-shared.h b/shared/systemd/sd-adapt-shared/nm-sd-adapt-shared.h
index 919f8264a1..e829532566 100644
--- a/shared/systemd/sd-adapt-shared/nm-sd-adapt-shared.h
+++ b/shared/systemd/sd-adapt-shared/nm-sd-adapt-shared.h
@@ -127,6 +127,7 @@ _nm_log_get_max_level_realm(void)
#include <sys/syscall.h>
#include <sys/ioctl.h>
+ #include <pthread.h>
#define ENABLE_GSHADOW FALSE
@@ -202,6 +203,17 @@ typedef __compar_fn_t comparison_fn_t;
typedef int (*__compar_d_fn_t)(const void *, const void *, void *);
#endif
+ #ifndef __GLIBC__
+static inline int
+__register_atfork(void (*prepare)(void),
+ void (*parent)(void),
+ void (*child)(void),
+ void *dso_handle)
+{
+ return pthread_atfork(prepare, parent, child);
+}
+ #endif
+
#endif /* (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_SYSTEMD */
/*****************************************************************************/