Add the FreeBSD platform specific code to get a thread id for the
logging system.
Change-Id: Ifd2a53c5c47e1b23a7f0a90c1fc0768e7f4dbcb3
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/11582
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
# include <mach.h>
#endif
+#ifdef __FreeBSD__
+# include <sys/thr.h>
+#endif
+
#include "common/assert.h"
#include "common/common.h"
#include "common/macros.h"
mach_port_deallocate(mach_task_self(), mach_port);
tid = (unsigned int) mach_port;
}
+#elif defined(__FreeBSD__)
+ {
+ long ltid;
+
+ thr_self(<id);
+
+ /*
+ * The thread ID is an integer in the range from
+ * `PID_MAX + 2` (100001) to `INT_MAX`.
+ */
+ tid = (unsigned int) ltid;
+ }
#else
# error "Platform not supported"
#endif