Skip to content

Commit 5d332d6

Browse files
Yifan ZhuSchrodingerZhu
authored andcommitted
initialize pid cache in startup
1 parent bdf5f91 commit 5d332d6

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

libc/startup/linux/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ add_object_library(
101101
libc.include.llvm-libc-macros.link_macros
102102
libc.src.__support.threads.thread
103103
libc.src.__support.OSUtil.osutil
104+
libc.src.__support.OSUtil.pid
104105
libc.src.stdlib.exit
105106
libc.src.stdlib.atexit
106107
libc.src.unistd.environ

libc/startup/linux/do_start.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//===----------------------------------------------------------------------===//
88
#include "startup/linux/do_start.h"
99
#include "include/llvm-libc-macros/link-macros.h"
10+
#include "src/__support/OSUtil/pid.h"
1011
#include "src/__support/OSUtil/syscall.h"
1112
#include "src/__support/threads/thread.h"
1213
#include "src/stdlib/atexit.h"
@@ -64,6 +65,7 @@ static ThreadAttributes main_thread_attrib;
6465
auto tid = syscall_impl<long>(SYS_gettid);
6566
if (tid <= 0)
6667
syscall_impl<long>(SYS_exit, 1);
68+
ProcessIdentity::refresh_cache();
6769
main_thread_attrib.tid = static_cast<int>(tid);
6870

6971
// After the argv array, is a 8-byte long NULL value before the array of env

0 commit comments

Comments
 (0)