MCPcopy Create free account
hub / github.com/Simple-XX/SimpleKernel / sys_set_tid_address

Function sys_set_tid_address

src/syscall.cpp:185–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183}
184
185[[nodiscard]] auto sys_set_tid_address([[maybe_unused]] int* tidptr) -> int {
186 auto current = TaskManagerSingleton::instance().GetCurrentTask();
187 if (!current) {
188 klog::Err("[Syscall] sys_set_tid_address: No current task");
189 return -1;
190 }
191
192 // 保存 tidptr,在线程退出时会清零该地址并执行 futex wake
193 /// @todo需要在 TaskControlBlock 中添加字段保存 tidptr
194 // current->clear_child_tid = tidptr;
195
196 // 返回当前线程的 TID
197 return static_cast<int>(current->pid);
198}
199
200[[nodiscard]] auto sys_futex(int* uaddr, int op, int val,
201 [[maybe_unused]] const void* timeout,

Callers 1

syscall_dispatcherFunction · 0.85

Calls 2

ErrFunction · 0.85
GetCurrentTaskMethod · 0.80

Tested by

no test coverage detected