#include <aul_rpc_port.h>
#include <aul_svc.h>
#include <bundle_internal.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/syscall.h>
#include <sys/types.h>
#include <ttrace.h>
#include <unistd.h>
constexpr const char K_SERVICE_THREAD[] = "__K_SERVICE_THREAD";
+void SetComm(const std::string& name) {
+ pid_t tid = syscall(__NR_gettid);
+ std::string path = "/proc/" + std::to_string(tid) + "/comm";
+ int fd = open(path.c_str(), O_WRONLY);
+ if (fd < 0) {
+ _E("open(%s) is failed. errno(%d)", path.c_str(), errno);
+ return;
+ }
+
+ ssize_t bytes_written = write(fd, name.c_str(), name.length() + 1);
+ if (bytes_written < 0)
+ _E("write(%d) is failed. errno(%d)", fd, errno);
+
+ close(fd);
+}
+
class AppCoreUiBase::Impl {
public:
Impl(AppCoreUiBase* parent, unsigned int hint)
setenv("TIZEN_GLIB_CONTEXT", env.c_str(), 1);
thread_ = std::thread([&] {
+ SetComm("UIThread+");
parent_->DoRun(argc, argv);
});