Skip to content

Commit

Permalink
Merge pull request #1221 from hermit-os/getpid
Browse files Browse the repository at this point in the history
fix(syscall): always return zero on `sys_getpid`
  • Loading branch information
stlankes committed May 22, 2024
2 parents e144a35 + 58c13f7 commit 0df2d02
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions src/scheduler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -960,10 +960,6 @@ pub unsafe fn spawn(
unsafe { PerCoreScheduler::spawn(func, arg, prio, core_id, stack_size) }
}

pub fn getpid() -> TaskId {
core_scheduler().get_current_task_id()
}

#[allow(clippy::result_unit_err)]
pub fn join(id: TaskId) -> Result<(), ()> {
let core_scheduler = core_scheduler();
Expand Down
2 changes: 1 addition & 1 deletion src/syscalls/tasks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub type Tid = i32;
#[hermit_macro::system]
#[no_mangle]
pub extern "C" fn sys_getpid() -> Tid {
core_scheduler().get_current_task_id().into()
0
}

#[cfg(feature = "newlib")]
Expand Down

0 comments on commit 0df2d02

Please sign in to comment.