apps: getpid should return process id not thread id

Summary:
   following the change in the nuttx kernel, implement the right semantics:
1. getpid should return the main thread id
2. gettid should return the current thread id

Refer:
 https://github.com/apache/incubator-nuttx/issues/2499
 https://github.com/apache/incubator-nuttx/pull/2518

Nuttx Kernel PR:
 https://github.com/apache/incubator-nuttx/pull/7597

update apps code

Testing PASSED with qemu( 32/64 )

Signed-off-by: qinwei1 <qinwei1@xiaomi.com>
This commit is contained in:
qinwei1
2022-11-11 14:20:43 +08:00
committed by Xiang Xiao
parent 0357cb99b2
commit c86509be4c
9 changed files with 17 additions and 17 deletions

View File

@@ -123,7 +123,7 @@ ssize_t netlib_get_nbtable(FAR struct neighbor_entry_s *nbtab,
/* Bind the socket so that we can use send() and receive() */
pid = getpid();
pid = gettid();
addr.nl_family = AF_NETLINK;
addr.nl_pad = 0;
addr.nl_pid = pid;