I want to set the cpu affinity of a process on linux when it is starting.
There are methods like sched_setaffinity and taskset, but they need the processid of the process. They may cause potential migration like a process was started on a core but after the use of sched_setaffinity/taskset, they were migrated to another core.
What I want to do is to start a new process on a specific core from the beginning.