//////////////////////// \brief SysKernelObjectWaitOne (object) Wait on one KernelObject \param object (handle_t) Object to wait on \return negative error code on failure ////////////////////////
| 2541 | /// \return negative error code on failure |
| 2542 | ///////////////////////////// |
| 2543 | long SysKernelObjectWaitOne(regs64_t* r){ |
| 2544 | process_t* currentProcess = Scheduler::GetCurrentProcess(); |
| 2545 | |
| 2546 | Handle* handle; |
| 2547 | if(Scheduler::FindHandle(currentProcess, SC_ARG0(r), &handle)){ |
| 2548 | Log::Warning("SysKernelObjectWaitOne: Invalid handle ID %d", SC_ARG0(r)); |
| 2549 | return -EINVAL; |
| 2550 | } |
| 2551 | |
| 2552 | KernelObjectWatcher watcher; |
| 2553 | |
| 2554 | watcher.WatchObject(handle->ko, 0); |
| 2555 | watcher.Wait(); |
| 2556 | |
| 2557 | return 0; |
| 2558 | } |
| 2559 | |
| 2560 | ///////////////////////////// |
| 2561 | /// \brief SysKernelObjectWait (objects, count) |
nothing calls this directly
no test coverage detected