Skip to content

Commit

Permalink
libgloss: kvx-cos: getpid: process id is constant
Browse files Browse the repository at this point in the history
Summary:
getpid returns a process id on Linux.
Therefore, we return the same id for a single
cluster, and different accross clusters.

Ref T22362

Test Plan: CI

Reviewers: O26 newlib!

Maniphest Tasks: T22362

Differential Revision: https://phab.kalray.eu/D33883
  • Loading branch information
julienhascoet committed Nov 20, 2023
1 parent 9d46e73 commit 55b1b48
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libgloss/kvx-cos/getpid.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
int
_getpid ()
{
return 0x1000 | (__cos_get_cluster_id() << 4) | __cos_get_cpu_id();
const int pcid = mppa_cos_get_physical_cluster_id();

return 0x1000 | (pcid << 4);
}

int getpid ()
Expand Down

0 comments on commit 55b1b48

Please sign in to comment.