| 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, |
no test coverage detected