Skip to content

Conversation

@wangchdo
Copy link
Contributor

@wangchdo wangchdo commented Nov 20, 2025

Summary

Fix build errors that occur when signals are disabled by excluding cmd_kill, cmd_sleep, cmd_usleep, and cmd_watch along with signal support.

Impact

Disabling signals will depend on this PR.

Testing

Tested the signal-disable option on the fvp-armv8r-aarch32 board with ostest disabled, based on the changes in apache/nuttx#17352

NuttShell (NSH)
nsh> [ 0] Idle_Task: nx_start: CPU0: Beginning Idle Loop
nsh> 
nsh> uname -a
NuttX 0.0.0 cce68d3ead-dirty Nov 20 2025 14:43:39 arm fvp-armv8r-aarch32
nsh> 
nsh> 
nsh> help
help usage:  help [-v] [<cmd>]

    .           cd          exec        ls          pwd         truncate    
    [           cp          exit        mkdir       rm          uname       
    ?           cmp         expr        mkrd        rmdir       umount      
    alias       dirname     false       mount       set         unset       
    unalias     df          fdinfo      mv          source      uptime      
    basename    dmesg       free        pidof       test        xd          
    break       echo        help        printf      time        
    cat         env         hexdump     ps          true        

Builtin Apps:
    dd       nsh      sh       hello    
nsh> 
nsh> 
nsh> hello
[ 2] nsh_main: task_spawn: name=hello entry=0x2f554 file_actions=0x20009a88 attr=0x20009a8c argv=0x20009b48
[ 2] nsh_main: spawn_execattrs: Setting policy=2 priority=100 for pid=3
[ 2] nsh_main: nxtask_activate: hello pid=3,TCB=0x2000a0a0
Hello, World!!
[ 3] hello: nxtask_exit: hello pid=3,TCB=0x2000a0a0
nsh> 
nsh> ps
  TID   PID  PPID PRI POLICY   TYPE    NPX STATE    EVENT     SIGMASK            STACK    USED FILLED COMMAND
    0     0     0   0 FIFO     Kthread   - Ready                       0008176 0000888  10.8%  Idle_Task
    1     0     0 192 RR       Kthread   - Waiting  Semaphore          0008128 0000432   5.3%  hpwork 0x200002e0 0x20000330
    2     2     0 100 RR       Task      - Running                     0008152 0001840  22.5%  nsh_main
nsh> 

Fix build errors that occur when signals are disabled by excluding
cmd_kill, cmd_sleep, cmd_usleep, and cmd_watch along with signal support.

Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
#endif
#ifndef CONFIG_NSH_DISABLE_USLEEP
#if !defined(CONFIG_NSH_DISABLE_USLEEP) && !defined(CONFIG_DISABLE_SIGNALS)
int cmd_usleep(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sleep is an important function, we need support the partial disable signal functionality to make CONFIG_DISABLE_SIGNALS is useful in the real case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants