In file included from nsh_ddcmd.c:44:
nsh_ddcmd.c: In function 'cmd_dd':
nsh_ddcmd.c:456:20: error: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'uint64_t' {aka 'long unsigned int'} [-Werror=format=]
456 | nsh_output(vtbl, "%llu bytes copied, %u usec, ",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
457 | total, (unsigned int)elapsed);
| ~~~~~
| |
| uint64_t {aka long unsigned int}
nsh_console.h:55:49: note: in definition of macro 'nsh_output'
55 | # define nsh_output(v, ...) (v)->output(v, ##__VA_ARGS__)
| ^~~~~~~~~~~
nsh_ddcmd.c:456:24: note: format string is defined here
456 | nsh_output(vtbl, "%llu bytes copied, %u usec, ",
| ~~~^
| |
| long long unsigned int
| %lu
cc1: all warnings being treated as errors
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
Summary:
do
{
nbyteswritten = write(wrfd, iobuffer, nbytesread);
if (nbyteswritten >= 0)
The write return type is ssize_t, which is different in size from the originally declared type, so the unified type is ssize_t
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
Currently new users when try to run NuttX using the SIM
get stuck into simulator, because they have no idea that
poweroff command is used to leave it. Let use KISS approach
and use quit as an alias to poweroff command.
Signed-off-by: Alan C. Assis <acassis@gmail.com>
The behavior of mkdir is used during the cp -r process, and the mkdir behavior is skipped when mkdir is unavailable (this may cause unpredictable behavior of cp -r)
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
Now the dd command can use the "seek" parameter to adjust how many bytes need to be skipped before being written to the target.
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
Currently NSH prompt is defined at build time, thus improper for AMP cases
where the same NSH binary is used on different nodes as the same NSH prompt
shows on all nodes.
This patch attempts to support runtime prompt string population from ordered
sources:
- the environment variable defined by NSH_PROMPT_ENV plus suffix
- the NSH_PROMPT_STRING
- the HOSTNAME plus suffix
The suffix is defined by NSH_PROMPT_SUFFIX so that to clearly separate the
command inputs.
Changes in `nshlib/`
- Kconfig: add configs NSH_PROMPT_MAX/ENV/SUFFIX etc
- nsh.h: adjust g_nshprompt defs, add nsh_update_prompt
- nsh_parse.c relocate g_nshpromt to nsh_prompt.c
- nsh_init.c revise to use nsh_update_prompt once
- nsh_session.c revise to use methods in nsh_prompt.c
- Makefile add nsh_prompt.c
- CMakeLists.txt add nsh_prompt.c
New additions in `nshlib/`
- nsh_prompt.c prompt related data structures and methods.
Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
This patch guards help message for ping sub-command so that it only
shows when the sub-command is enabled.
Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
The alloca() function is machine- and compiler-dependent. For certain
applications, its use can improve efficiency compared to the use of
malloc(3) plus free(3). In certain cases, it can also simplify memory
deallocation in applications that use longjmp(3) or siglongjmp(3).
Otherwise, its use is discouraged.
Signed-off-by: chao an <anchao@lixiang.com>
To support rpmsg ioctl, add cmd_rpmsg function, and update rptun ping to rpmsg ping.
depends on apache/nuttx#11618
Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
the ping subcommand is guarded with RPTUN_PING in its handler.
its help mesg should have same guard to avoid confusing user.
Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
This commit corresponds to apache/nuttx#11498 in nuttx.
Move etc romfs mount to sched/init for compatibility with kernel/protected mode.
changes:
- move etc romfs mount from nsh to Nuttx, but keep the script to parse and execute.
- move and rename the related CONFIG, move customized nsh_romfsimg.h to etc_romfs.c
in boards, and no need declaration for romfs_img/romfs_img_len.
Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
"dns" option of `ifconfig` can work just with `CONFIG_NETDB_DNSCLIENT`,
no need to depend on `CONFIG_NETINIT_DNS` or `CONFIG_NETINIT_DHCPC`.
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
Switch the order of setting network mask and gateway, re-order only, no
logic change.
In IPv6 cases, we may set `addr6` and prefix length together to an
interface, but the gateway logic may change the value in `addr6`, and
result in wrong address set to the interface.
The order doesn't change behavior in network stack, so we just need to
make sure the value is correct.
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
Locking the scheduler prior to calling posix_spawn() might lock the
scheduler for a relatively long time, if the file to be loaded is large.
posix_spawn() loads the process into memory, possibly linking it as well
if the binary format is linkable (elf). This can take tens / hundreds of
milliseconds, which basically destroys the OS's real time performance.
Missing the death-of-child signal is a very trivial penalty considering
the alternative.
Simplify the "cmd_codecs_proc" md5 related framework and modify the implementation of the command md5:
Signed-off-by: wangmingrong <wangmingrong@xiaomi.com>