From 3fe371f60f2e1183b8b2c664313c3aa08732afda Mon Sep 17 00:00:00 2001 From: Petro Karashchenko Date: Fri, 7 Jul 2023 12:41:46 +0300 Subject: [PATCH] nuttx: replace getpid() with nxsched_getpid() in kernel code Signed-off-by: Petro Karashchenko --- net/netlink/netlink_attr.c | 6 +++--- sched/pthread/pthread_join.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/net/netlink/netlink_attr.c b/net/netlink/netlink_attr.c index 4d82c10b26..a969e23cb0 100644 --- a/net/netlink/netlink_attr.c +++ b/net/netlink/netlink_attr.c @@ -29,8 +29,8 @@ #include #include #include -#include +#include #include #include "netlink.h" @@ -129,7 +129,7 @@ static int validate_nla(FAR const struct nlattr *nla, int maxtype, if (g_nla_attr_len[pt->type] && attrlen != g_nla_attr_len[pt->type]) { nwarn("netlink: '%d': attribute type %d has an invalid length.\n", - getpid(), type); + nxsched_getpid(), type); return -EINVAL; } @@ -324,7 +324,7 @@ int nla_parse(FAR struct nlattr **tb, int maxtype, if (rem > 0) { nwarn("netlink: %d bytes leftover after parsing attributes in " - "pid `%d'.\n", rem, getpid()); + "pid `%d'.\n", rem, nxsched_getpid()); } errout: diff --git a/sched/pthread/pthread_join.c b/sched/pthread/pthread_join.c index 7eda733cd4..9c27cde9aa 100644 --- a/sched/pthread/pthread_join.c +++ b/sched/pthread/pthread_join.c @@ -88,7 +88,7 @@ int pthread_join(pthread_t thread, FAR pthread_addr_t *pexit_value) * ourself. */ - if ((pid_t)thread == gettid()) + if ((pid_t)thread == nxsched_gettid()) { leave_cancellation_point(); return EDEADLK;