From d36d1118aab304557a54411fc52f114cce282d87 Mon Sep 17 00:00:00 2001 From: wenlong_12 Date: Tue, 19 Mar 2024 16:13:10 +0800 Subject: [PATCH] changed function interfaces to get the right id Signed-off-by: wenlong_12 --- frameworks/libhilog/hilog_printf.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frameworks/libhilog/hilog_printf.cpp b/frameworks/libhilog/hilog_printf.cpp index cc79daa..61b47ea 100644 --- a/frameworks/libhilog/hilog_printf.cpp +++ b/frameworks/libhilog/hilog_printf.cpp @@ -305,7 +305,7 @@ int HiLogPrintArgs(const LogType type, const LogLevel level, const unsigned int header.level = level; #ifndef __RECV_MSG_WITH_UCRED_ #ifndef __WINDOWS__ - header.pid = getpid(); + header.pid = getprocpid(); #else header.pid = static_cast(GetCurrentProcessId()); #endif @@ -317,7 +317,7 @@ int HiLogPrintArgs(const LogType type, const LogLevel level, const unsigned int pthread_threadid_np(NULL, &tid); header.tid = static_cast(tid); #else - header.tid = static_cast(syscall(SYS_gettid)); + header.tid = static_cast(getproctid()); #endif header.domain = domain; -- Gitee