From 73c8f117234032b24caa2d33d2c235911755752d Mon Sep 17 00:00:00 2001 From: wylyw78 Date: Fri, 14 Jun 2024 11:06:39 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=80=82=E9=85=8DLinux=20arm=20host=20open?= =?UTF-8?q?harmony=E7=BC=96=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wylyw78 --- frameworks/libhilog/base/hilog_base.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frameworks/libhilog/base/hilog_base.c b/frameworks/libhilog/base/hilog_base.c index 6c26bf2..5869683 100644 --- a/frameworks/libhilog/base/hilog_base.c +++ b/frameworks/libhilog/base/hilog_base.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -32,6 +33,10 @@ static const int SOCKET_TYPE = SOCK_DGRAM | SOCK_NONBLOCK | SOCK_CLOEXEC; static const struct sockaddr_un SOCKET_ADDR = {AF_UNIX, SOCKET_FILE_DIR INPUT_SOCKET_NAME}; +static inline pid_t gettid(void) { + return syscall(SYS_gettid); +} + static int SendMessage(HilogMsg *header, const char *tag, uint16_t tagLen, const char *fmt, uint16_t fmtLen) { // The hilogbase interface cannot has mutex, so need to re-open and connect to the socketof the hilogd -- Gitee From 7be1d24daaa042747288883819e00cf5bef364de Mon Sep 17 00:00:00 2001 From: wenyu Date: Tue, 18 Jun 2024 08:24:01 +0000 Subject: [PATCH 2/2] update frameworks/libhilog/base/hilog_base.c. Signed-off-by: wenyu --- frameworks/libhilog/base/hilog_base.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frameworks/libhilog/base/hilog_base.c b/frameworks/libhilog/base/hilog_base.c index 5869683..ac68624 100644 --- a/frameworks/libhilog/base/hilog_base.c +++ b/frameworks/libhilog/base/hilog_base.c @@ -33,10 +33,11 @@ static const int SOCKET_TYPE = SOCK_DGRAM | SOCK_NONBLOCK | SOCK_CLOEXEC; static const struct sockaddr_un SOCKET_ADDR = {AF_UNIX, SOCKET_FILE_DIR INPUT_SOCKET_NAME}; -static inline pid_t gettid(void) { - return syscall(SYS_gettid); +if (host_cpu == "arm64") { + static inline pid_t gettid(void) { + return syscall(SYS_gettid); + } } - static int SendMessage(HilogMsg *header, const char *tag, uint16_t tagLen, const char *fmt, uint16_t fmtLen) { // The hilogbase interface cannot has mutex, so need to re-open and connect to the socketof the hilogd -- Gitee