Cygwin: Add clone compat layer
authorChristian Babeux <christian.babeux@efficios.com>
Thu, 29 Nov 2012 16:13:48 +0000 (11:13 -0500)
committerChristian Babeux <christian.babeux@efficios.com>
Fri, 7 Dec 2012 20:17:54 +0000 (15:17 -0500)
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 <christian.babeux@efficios.com>
src/common/compat/clone.h

index 581595be05d8522ee41ea9ef549e4c69d5530acf..13e88d418ac15895f3f1bc0febb327dde5f07eea 100644 (file)
@@ -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 <assert.h>
+
+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 */
This page took 0.026259 seconds and 4 git commands to generate.