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-22 23:26:51 +0100
commit60634c172d2031a37def0ad9f7d77440df377523 (patch)
tree36fa34b5f6de7720620c95f9a83589beb88c01f1
parenta9a8ca83400058ea783d565503995471330489b2 (diff)
downloadNetworkManager-60634c172d2031a37def0ad9f7d77440df377523.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 */
/*****************************************************************************/