X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcommon%2Fcompat%2Fclone.h;h=6685c6f6e9ed084ac5817beb5abe4c4f635a0e9f;hb=7657ae75b85d728d84c2f540df6a3739a167090c;hp=45eb37982c225c9551fe10b3f3f8ba909092a8e4;hpb=373d38732a83167f19c3be89cf9ff238743cdeb0;p=lttng-tools.git diff --git a/src/common/compat/clone.h b/src/common/compat/clone.h index 45eb37982..6685c6f6e 100644 --- a/src/common/compat/clone.h +++ b/src/common/compat/clone.h @@ -22,23 +22,24 @@ #include -#elif __FreeBSD__ - -#include +static inline +int lttng_clone_files(int (*fn)(void *), void *child_stack, void *arg) +{ + return clone(fn, child_stack, CLONE_FILES | SIGCHLD, arg); +} -#define CLONE_FILES 0 +#elif defined(__FreeBSD__) -#define clone(fct_ptr, child_stack, flags, arg, args...) \ - compat_clone(fct_ptr, child_stack, flags, arg) +#include -int compat_clone(int (*fn)(void *), void *child_stack, int flags, - void *arg) +static inline +int lttng_clone_files(int (*fn)(void *), void *child_stack, void *arg) { - return -ENOSYS; + return rfork(RFPROC | RFTHREAD); } #else -#error "Please add support for your OS into compat/clone.h." +#error "Please add support for your OS." #endif /* __linux__ , __FreeBSD__ */ #endif /* _COMPAT_CLONE_H */