#include <sys/types.h>
#include <sys/socket.h>
+#include <sys/prctl.h>
#include <unistd.h>
#include <errno.h>
#include <pthread.h>
int register_app_to_sessiond(int socket)
{
ssize_t ret;
+ int prctl_ret;
struct {
uint32_t major;
uint32_t minor;
pid_t pid;
+ pid_t ppid;
uid_t uid;
+ gid_t gid;
+ 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.ppid = getppid();
reg_msg.uid = getuid();
+ reg_msg.gid = getgid();
+ 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))
return 0;
sock_info->constructor_sem_posted = 1;
ret = uatomic_add_return(&sem_count, -1);
- fprintf(stderr, "DEC ret %d\n", ret);
if (ret == 0) {
- fprintf(stderr, "POST\n");
ret = sem_post(&constructor_wait);
assert(!ret);
}
lttng_ust_comm_should_quit = 1;
pthread_mutex_unlock(<tng_ust_comm_mutex);
-#if 0
ret = pthread_cancel(global_apps.ust_listener);
if (ret) {
ERR("Error cancelling global ust listener thread");
}
-#endif //0
cleanup_sock_info(&global_apps);