[lttng-dev] [PATCH lttng-tools 10/14] Added HOST_NAME_MAX definition to compat/socket.h if not already defined (which is the case for android)

Charles Briere charlesbriere.flatzo at gmail.com
Mon May 6 14:18:47 EDT 2013


From: Pierre-Luc St-Charles <pierre-luc.st-charles at polymtl.ca>

Signed-off-by: Pierre-Luc St-Charles <pierre-luc.st-charles at polymtl.ca>
---
 src/bin/lttng-sessiond/consumer.c     | 1 +
 src/bin/lttng-sessiond/ust-metadata.c | 1 +
 src/common/compat/socket.h            | 9 +++++++++
 3 files changed, 11 insertions(+)

diff --git a/src/bin/lttng-sessiond/consumer.c b/src/bin/lttng-sessiond/consumer.c
index e3d1be0..98d79e4 100644
--- a/src/bin/lttng-sessiond/consumer.c
+++ b/src/bin/lttng-sessiond/consumer.c
@@ -25,6 +25,7 @@
 #include <unistd.h>
 #include <inttypes.h>
 
+#include <common/compat/socket.h>
 #include <common/common.h>
 #include <common/defaults.h>
 #include <common/uri.h>
diff --git a/src/bin/lttng-sessiond/ust-metadata.c b/src/bin/lttng-sessiond/ust-metadata.c
index b0f83d2..28f4d1a 100644
--- a/src/bin/lttng-sessiond/ust-metadata.c
+++ b/src/bin/lttng-sessiond/ust-metadata.c
@@ -28,6 +28,7 @@
 #include <unistd.h>
 #include <inttypes.h>
 #include <common/common.h>
+#include <common/compat/socket.h>
 
 #include "ust-registry.h"
 #include "ust-clock.h"
diff --git a/src/common/compat/socket.h b/src/common/compat/socket.h
index 4d2925f..46aa9c5 100644
--- a/src/common/compat/socket.h
+++ b/src/common/compat/socket.h
@@ -23,6 +23,15 @@
 
 #include <common/macros.h>
 
+#ifndef HOST_NAME_MAX
+/* 
+ * On some platforms (such as Android), this define might not be
+ * exposed in any kernel headers; the most commonly assigned value
+ * is 64. This can be verified using getconf HOST_MAX_NAME.
+ */
+#define HOST_NAME_MAX 64
+#endif
+
 #ifdef __linux__
 
 #define LTTNG_SOCK_CREDS SCM_CREDENTIALS
-- 
1.8.1.msysgit.1




More information about the lttng-dev mailing list