You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2023/06/16 05:31:21 UTC

[nuttx] branch master updated (17c65d2067 -> 275db394bc)

This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


    from 17c65d2067 risc-v/espressif: use the unquoted `CHIP_SERIES` variable
     new c49bf046bd libc/fdcheck: Fix undefined reference to `getppid'
     new 275db394bc boards/sim: Enable fdcheck and fdsan in kasan config

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 boards/sim/sim/sim/configs/kasan/defconfig | 2 ++
 libs/libc/misc/lib_fdcheck.c               | 7 ++++---
 2 files changed, 6 insertions(+), 3 deletions(-)


[nuttx] 02/02: boards/sim: Enable fdcheck and fdsan in kasan config

Posted by pk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 275db394bc2b44a428b350aa208619472f08f5af
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Thu Jun 15 21:15:08 2023 +0800

    boards/sim: Enable fdcheck and fdsan in kasan config
    
    to improve the ci build coverage
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 boards/sim/sim/sim/configs/kasan/defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/boards/sim/sim/sim/configs/kasan/defconfig b/boards/sim/sim/sim/configs/kasan/defconfig
index 2c16fb9749..ffbcc91e54 100644
--- a/boards/sim/sim/sim/configs/kasan/defconfig
+++ b/boards/sim/sim/sim/configs/kasan/defconfig
@@ -19,6 +19,8 @@ CONFIG_DEBUG_SYMBOLS=y
 CONFIG_DEV_LOOP=y
 CONFIG_DEV_ZERO=y
 CONFIG_EXAMPLES_HELLO=y
+CONFIG_FDCHECK=y
+CONFIG_FDSAN=y
 CONFIG_FS_AIO=y
 CONFIG_FS_BINFS=y
 CONFIG_FS_NAMED_SEMAPHORES=y


[nuttx] 01/02: libc/fdcheck: Fix undefined reference to `getppid'

Posted by pk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit c49bf046bd5598625adf2397d820632f64f5bdb0
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Thu Jun 15 20:09:01 2023 +0800

    libc/fdcheck: Fix undefined reference to `getppid'
    
    and change get[p]pid to  _SCHED_GET[P]PID
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 libs/libc/misc/lib_fdcheck.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libs/libc/misc/lib_fdcheck.c b/libs/libc/misc/lib_fdcheck.c
index 4129e8976c..e174483884 100644
--- a/libs/libc/misc/lib_fdcheck.c
+++ b/libs/libc/misc/lib_fdcheck.c
@@ -24,6 +24,7 @@
 
 #include <nuttx/fdcheck.h>
 #include <nuttx/lib/math32.h>
+#include <nuttx/sched.h>
 
 #include <debug.h>
 #include <stdio.h>
@@ -83,8 +84,8 @@ int fdcheck_restore(int val)
     }
 
   pid_expect = (val >> PID_SHIFT);
-  pid_now = (getpid() & PID_MASK);
-  ppid_now = (getppid() & PID_MASK);
+  pid_now = (_SCHED_GETPID() & PID_MASK);
+  ppid_now = (_SCHED_GETPPID() & PID_MASK);
   if (pid_expect != pid_now && pid_expect != ppid_now && pid_expect != 0)
     {
       ferr("pid_expect %d pid_now %d ppid_now %d\n",
@@ -124,7 +125,7 @@ int fdcheck_protect(int fd)
       return fd;
     }
 
-  return (fd & FD_MASK) | ((getpid() & PID_MASK) << PID_SHIFT);
+  return (fd & FD_MASK) | ((_SCHED_GETPID() & PID_MASK) << PID_SHIFT);
 }
 
 #endif