mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-23 09:39:16 +08:00
Pack parameters of nsh_execute() as struct nsh_exec_param_s
1. Input redirect flags currently is hardcode, passing by arguments maybe better. 2. Only support redirect to path_name, redirect to fd is needed for pipeline. Test 1. Redirect in cat < /etc/init.d/rc.sysinit 2. Redirect with FIFO mkfifo /dev/testfifo cat /dev/testfifo & ls > /dev/testfifo 3. NSH Params set name `uname` echo $name Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
This commit is contained in:
@@ -65,6 +65,25 @@
|
||||
# define SCHED_NSH SCHED_FIFO
|
||||
#endif
|
||||
|
||||
struct nsh_param_s
|
||||
{
|
||||
/* Redirect input/output through `fd` OR `path_name`
|
||||
*
|
||||
* Select one:
|
||||
* 1. Using fd_in/fd_out as oldfd for dup2() if greater than -1.
|
||||
* 2. Using file_in/file_out as full path to the file if it is
|
||||
* not NULL, and oflags_in/oflags_out as flags for open().
|
||||
*/
|
||||
|
||||
int fd_in;
|
||||
int fd_out;
|
||||
|
||||
int oflags_in;
|
||||
int oflags_out;
|
||||
FAR const char *file_in;
|
||||
FAR const char *file_out;
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
Reference in New Issue
Block a user