From 2629549eb1e9a5d9673123a8e9b09e3b6703a47b Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 25 Aug 2011 16:55:31 -0400 Subject: [PATCH] Send comm name on register Signed-off-by: Mathieu Desnoyers --- libust/lttng-ust-comm.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libust/lttng-ust-comm.c b/libust/lttng-ust-comm.c index ebc9419..4bc13ae 100644 --- a/libust/lttng-ust-comm.c +++ b/libust/lttng-ust-comm.c @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -116,17 +117,24 @@ static int register_app_to_sessiond(int socket) { ssize_t ret; + int prctl_ret; struct { uint32_t major; uint32_t minor; pid_t pid; uid_t uid; + char name[16]; /* process name */ } reg_msg; reg_msg.major = LTTNG_UST_COMM_VERSION_MAJOR; reg_msg.minor = LTTNG_UST_COMM_VERSION_MINOR; reg_msg.pid = getpid(); reg_msg.uid = getuid(); + prctl_ret = prctl(PR_GET_NAME, (unsigned long) reg_msg.name, 0, 0, 0); + if (prctl_ret) { + ERR("Error executing prctl"); + return -errno; + } ret = lttcomm_send_unix_sock(socket, ®_msg, sizeof(reg_msg)); if (ret >= 0 && ret != sizeof(reg_msg)) -- 2.34.1