From 8d804f736eb06e892e74f32df00ea0bdb974a410 Mon Sep 17 00:00:00 2001 From: Christian Babeux Date: Thu, 29 Nov 2012 11:13:48 -0500 Subject: [PATCH] Cygwin: Add clone compat layer Cygwin doesn't support the clone() syscall [1]. Users must explicitly set the LTTNG_DEBUG_NOCLONE environment variable. [1] - http://cygwin.com/ml/cygwin/2009-05/msg00172.html Signed-off-by: Christian Babeux --- src/common/compat/clone.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/common/compat/clone.h b/src/common/compat/clone.h index 581595be0..13e88d418 100644 --- a/src/common/compat/clone.h +++ b/src/common/compat/clone.h @@ -56,8 +56,19 @@ pid_t lttng_clone_files(int (*fn)(void *), void *child_stack, void *arg) } } +#elif defined(__CYGWIN__) +#warning "Cygwin doesn't support the clone() syscall. You must set the LTTNG_DEBUG_NOCLONE=1 before starting lttng-sessiond" +#include + +static inline +pid_t lttng_clone_files(int (*fn)(void *), void *child_stack, void *arg) +{ + assert(NULL); + return -1; +} + #else #error "Please add support for your OS." -#endif /* __linux__ , __FreeBSD__ */ +#endif /* __linux__ , __FreeBSD__, __CYGWIN__ */ #endif /* _COMPAT_CLONE_H */ -- 2.34.1