patacongo removed a comment on pull request #2938: URL: https://github.com/apache/incubator-nuttx/pull/2938#issuecomment-788921674
> > > There are many places inovke getpid, we need time to check each place and ensure the right function get called:(. Perhaps we could put the changes on a branch. I could help out some with the conversion. However, we should wait until after the next 10.1.x release to give the changes as much time as possible to mature before 10.2. There should be no real use of the (corrected) getpid within the OS other than at the OS API. There are several functions that take the pid as a parameter (and usually if the pid is zero, then it should use getpid() to get the pid of the caller). I suppose these should return only information for the main thread: ``` sched.h:int task_delete(pid_t pid); sched.h:int task_restart(pid_t pid); sched.h:int sched_setparam(pid_t pid, FAR const struct sched_param *param); sched.h:int sched_getparam(pid_t pid, FAR struct sched_param *param); sched.h:int sched_setscheduler(pid_t pid, int policy, sched.h:int sched_getscheduler(pid_t pid); sched.h:int sched_rr_get_interval(pid_t pid, FAR struct timespec *interval); sched.h:int sched_setaffinity(pid_t pid, size_t cpusetsize, sched.h:int sched_getaffinity(pid_t pid, size_t cpusetsize, FAR cpu_set_t *mask); signal.h:int kill(pid_t pid, int signo); spawn.h:int posix_spawnp(FAR pid_t *pid, FAR const char *path, spawn.h:int posix_spawn(FAR pid_t *pid, FAR const char *path, spawn.h:int task_spawn(FAR pid_t *pid, FAR const char *name, main_t entry, termios.h:pid_t tcgetsid(int fd); unistd.h:pid_t vfork(void); unistd.h:pid_t getpid(void); unistd.h:pid_t gettid(void); unistd.h:pid_t getppid(void); ``` Within the OS, I think that all of the internal calls to getpid() can be converted gettid(). There is also a lot of naming of variables and structure fields that would need to be corrected. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org