diff --git a/frameworks/libhilog/base/hilog_base.c b/frameworks/libhilog/base/hilog_base.c index 6c26bf237fe1e5619c12979c5f47b8530c685d12..ac686249f6deda06daac4813cb13df0b53724026 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,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}; +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