binfmt/ and libs/libc: Make exepath_*() more common:
1. Move exepath_*() related code to libc/misc 1. Rename exepath_ to envpath_ 2. Rename BINFMT_EXEPATH to LIB_ENVPATH libs/libc/modlib: Add pre module library symbol table support
This commit is contained in:
parent
da737f3167
commit
6509a0c0ca
@ -186,7 +186,7 @@ struct binary_s
|
|||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<p><small>
|
<p><small>
|
||||||
<sup>1</sup>The <code>filename</code> must be the full, absolute path to the file to be executed unless <code>CONFIG_BINFMT_EXEPATH</code> is defined.
|
<sup>1</sup>The <code>filename</code> must be the full, absolute path to the file to be executed unless <code>CONFIG_LIB_ENVPATH</code> is defined.
|
||||||
In that case, <code>filename</code> may be a relative path;
|
In that case, <code>filename</code> may be a relative path;
|
||||||
a set of candidate absolute paths will be generated using the <code>PATH</code> environment variable and <a href="#load_module"><code>load_module()</code></a> will attempt to load each file that is found at those absolute paths.
|
a set of candidate absolute paths will be generated using the <code>PATH</code> environment variable and <a href="#load_module"><code>load_module()</code></a> will attempt to load each file that is found at those absolute paths.
|
||||||
</small></p>
|
</small></p>
|
||||||
@ -224,9 +224,9 @@ typedef FAR void (*binfmt_dtor_t)(void);
|
|||||||
<code>PATH</code> traversal logic:
|
<code>PATH</code> traversal logic:
|
||||||
</h3>
|
</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<a href="#exepath_init">2.3.8 <code>exepath_init()</code></a><br>
|
<a href="#envpath_init">2.3.8 <code>envpath_init()</code></a><br>
|
||||||
<a href="#exepath_next">2.3.9 <code>exepath_next()</code></a><br>
|
<a href="#envpath_next">2.3.9 <code>envpath_next()</code></a><br>
|
||||||
<a href="#exepath_release">2.3.10 <code>exepath_release()</code></a>
|
<a href="#envpath_release">2.3.10 <code>envpath_release()</code></a>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h3>2.3.1 <a name="register_binfmt"><code>register_binfmt()</code></a></h3>
|
<h3>2.3.1 <a name="register_binfmt"><code>register_binfmt()</code></a></h3>
|
||||||
@ -273,7 +273,7 @@ int load_module(FAR struct binary_s *bin);
|
|||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<code>load_module()</code> will use the <code>filename</code> field in the <a href="#binfmtdata"><code>struct binary_s</code></a> in order to locate the module to be loaded from the file system.
|
<code>load_module()</code> will use the <code>filename</code> field in the <a href="#binfmtdata"><code>struct binary_s</code></a> in order to locate the module to be loaded from the file system.
|
||||||
The <code>filename</code> must be the full, absolute path to the file to be executed unless <code>CONFIG_BINFMT_EXEPATH</code> is defined.
|
The <code>filename</code> must be the full, absolute path to the file to be executed unless <code>CONFIG_LIB_ENVPATH</code> is defined.
|
||||||
In that case, <code>filename</code> may be a relative path;
|
In that case, <code>filename</code> may be a relative path;
|
||||||
a set of candidate absolute paths will be generated using the <code>PATH</code> environment variable and <code>load_module()</code> will attempt to load each file that is found at those absolute paths.
|
a set of candidate absolute paths will be generated using the <code>PATH</code> environment variable and <code>load_module()</code> will attempt to load each file that is found at those absolute paths.
|
||||||
</p>
|
</p>
|
||||||
@ -345,12 +345,12 @@ int exec(FAR const char *filename, FAR const char **argv,
|
|||||||
On failure, it returns -1 (<code>ERROR</code>) with <code>errno</code> set appropriately.
|
On failure, it returns -1 (<code>ERROR</code>) with <code>errno</code> set appropriately.
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h3>2.3.8 <a name="exepath_init"><code>exepath_init()</code></a></h3>
|
<h3>2.3.8 <a name="envpath_init"><code>envpath_init()</code></a></h3>
|
||||||
<p><b>Function Prototype:</b></p>
|
<p><b>Function Prototype:</b></p>
|
||||||
<ul><pre>
|
<ul><pre>
|
||||||
#include <:nuttx/binfmt/binfmt.h>
|
#include <:nuttx/envpath.h>
|
||||||
#ifdef CONFIG_BINFMT_EXEPATH
|
#ifdef CONFIG_LIB_ENVPATH
|
||||||
EXEPATH_HANDLE exepath_init(void);
|
ENVPATH_HANDLE envpath_init(void);
|
||||||
#endif
|
#endif
|
||||||
</pre></ul>
|
</pre></ul>
|
||||||
<p><b>Description:</b></p>
|
<p><b>Description:</b></p>
|
||||||
@ -361,31 +361,31 @@ EXEPATH_HANDLE exepath_init(void);
|
|||||||
</p>
|
</p>
|
||||||
<ol>
|
<ol>
|
||||||
<li>
|
<li>
|
||||||
Call <code>exepath_init()</code> to initialize for the traversal.
|
Call <code>envpath_init()</code> to initialize for the traversal.
|
||||||
<code>exepath_init()</code> will return an opaque handle that can then be provided to <code>exepath_next()</code> and <code>exepath_release()</code>.
|
<code>envpath_init()</code> will return an opaque handle that can then be provided to <code>envpath_next()</code> and <code>envpath_release()</code>.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
Call <code>exepath_next()</code> repeatedly to examine every file that lies in the directories of the <code>PATH</code> variable.
|
Call <code>envpath_next()</code> repeatedly to examine every file that lies in the directories of the <code>PATH</code> variable.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
Call <code>exepath_release()</code> to free resources set aside by <code>exepath_init()</code>.
|
Call <code>envpath_release()</code> to free resources set aside by <code>envpath_init()</code>.
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</ul>
|
</ul>
|
||||||
<p><b>Input Parameters:</b> <i>None</i></p>
|
<p><b>Input Parameters:</b> <i>None</i></p>
|
||||||
<p><b>Returned Value:</b></p>
|
<p><b>Returned Value:</b></p>
|
||||||
<ul>
|
<ul>
|
||||||
On success, <code>exepath_init()</code> return a non-<code>NULL</code>, opaque handle that may subsequently be used in calls to <code>exepath_next()</code> and <code>exepath_release()</code>.
|
On success, <code>envpath_init()</code> return a non-<code>NULL</code>, opaque handle that may subsequently be used in calls to <code>envpath_next()</code> and <code>envpath_release()</code>.
|
||||||
On error, a <code>NULL</code> handle value will be returned.
|
On error, a <code>NULL</code> handle value will be returned.
|
||||||
The most likely cause of an error would be that there is no value associated with the <code>PATH</code> variable.
|
The most likely cause of an error would be that there is no value associated with the <code>PATH</code> variable.
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h3>2.3.9 <a name="exepath_next"><code>exepath_next()</code></a></h3>
|
<h3>2.3.9 <a name="envpath_next"><code>envpath_next()</code></a></h3>
|
||||||
<p><b>Function Prototype:</b></p>
|
<p><b>Function Prototype:</b></p>
|
||||||
<ul><pre>
|
<ul><pre>
|
||||||
#include <:nuttx/binfmt/binfmt.h>
|
#include <:nuttx/envpath.h>
|
||||||
#ifdef CONFIG_BINFMT_EXEPATH
|
#ifdef CONFIG_LIB_ENVPATH
|
||||||
FAR char *exepath_next(EXEPATH_HANDLE handle, FAR const char *relpath);
|
FAR char *envpath_next(ENVPATH_HANDLE handle, FAR const char *relpath);
|
||||||
#endif
|
#endif
|
||||||
</pre></ul>
|
</pre></ul>
|
||||||
<p><b>Description:</b></p>
|
<p><b>Description:</b></p>
|
||||||
@ -394,7 +394,7 @@ FAR char *exepath_next(EXEPATH_HANDLE handle, FAR const char *relpath);
|
|||||||
</ul>
|
</ul>
|
||||||
<p><b>Input Parameters:</b></p>
|
<p><b>Input Parameters:</b></p>
|
||||||
<ul>
|
<ul>
|
||||||
<li><code>handle</code>: The handle value returned by <code>exepath_init()</code>.</li>
|
<li><code>handle</code>: The handle value returned by <code>envpath_init()</code>.</li>
|
||||||
<li><code>relpath</code>: The relative path to the file to be found.</li>
|
<li><code>relpath</code>: The relative path to the file to be found.</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p><b>Returned Value:</b></p>
|
<p><b>Returned Value:</b></p>
|
||||||
@ -410,27 +410,27 @@ FAR char *exepath_next(EXEPATH_HANDLE handle, FAR const char *relpath);
|
|||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<code>NULL</code is returned if no path is found to any file with the provided <code>relpath</colde> from any absolute path in the <code>PATH</code> variable.
|
<code>NULL</code is returned if no path is found to any file with the provided <code>relpath</colde> from any absolute path in the <code>PATH</code> variable.
|
||||||
In this case, there is no point in calling <code>exepath_next()</code> further; <code>exepath_release()</code> must be called to release resources set aside by <code>expath_init()</code>.
|
In this case, there is no point in calling <code>envpath_next()</code> further; <code>envpath_release()</code> must be called to release resources set aside by <code>expath_init()</code>.
|
||||||
</p>
|
</p>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h3>2.3.10- <a name="exepath_release"><code>exepath_release()</code></a></h3>
|
<h3>2.3.10- <a name="envpath_release"><code>envpath_release()</code></a></h3>
|
||||||
<p><b>Function Prototype:</b></p>
|
<p><b>Function Prototype:</b></p>
|
||||||
<ul><pre>
|
<ul><pre>
|
||||||
#include <:nuttx/binfmt/binfmt.h>
|
#include <:nuttx/envpath.h>
|
||||||
#ifdef CONFIG_BINFMT_EXEPATH
|
#ifdef CONFIG_LIB_ENVPATH
|
||||||
void exepath_release(EXEPATH_HANDLE handle);
|
void envpath_release(ENVPATH_HANDLE handle);
|
||||||
#endif
|
#endif
|
||||||
</pre></ul>
|
</pre></ul>
|
||||||
<p><b>Description:</b></p>
|
<p><b>Description:</b></p>
|
||||||
<ul>
|
<ul>
|
||||||
Release all resources set aside by <code>exepath_init</code> when the handle value was created.
|
Release all resources set aside by <code>envpath_init</code> when the handle value was created.
|
||||||
The handle value is invalid on return from this function.
|
The handle value is invalid on return from this function.
|
||||||
Attempts to all <code>exepath_next()</code> or <code>exepath_release()</code> with such a <i>stale</i> handle will result in undefined (i.e., not good) behavior.
|
Attempts to all <code>envpath_next()</code> or <code>envpath_release()</code> with such a <i>stale</i> handle will result in undefined (i.e., not good) behavior.
|
||||||
</ul>
|
</ul>
|
||||||
<p><b>Input Parameters:</b></p>
|
<p><b>Input Parameters:</b></p>
|
||||||
<ul>
|
<ul>
|
||||||
<li><code>handle</code>: The handle value returned by <code>exepath_init()</code>.</li>
|
<li><code>handle</code>: The handle value returned by <code>envpath_init()</code>.</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p><b>Returned Value:</b> <i>None</i></p>
|
<p><b>Returned Value:</b> <i>None</i></p>
|
||||||
|
|
||||||
|
@ -875,7 +875,7 @@ int exec(FAR const char *filename, FAR char * const *argv,
|
|||||||
<li>
|
<li>
|
||||||
<code>filename</code>:
|
<code>filename</code>:
|
||||||
The path to the program to be executed.
|
The path to the program to be executed.
|
||||||
If <code>CONFIG_BINFMT_EXEPATH</code> is defined in the configuration, then this may be a relative path from the current working directory.
|
If <code>CONFIG_LIB_ENVPATH</code> is defined in the configuration, then this may be a relative path from the current working directory.
|
||||||
Otherwise, <code>path</code> must be the absolute path to the program.
|
Otherwise, <code>path</code> must be the absolute path to the program.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
@ -969,7 +969,7 @@ int execv(FAR const char *path, FAR char *const argv[]);
|
|||||||
<li>
|
<li>
|
||||||
<code>path</code>:
|
<code>path</code>:
|
||||||
The path to the program to be executed.
|
The path to the program to be executed.
|
||||||
If <code>CONFIG_BINFMT_EXEPATH</code> is defined in the configuration, then this may be a relative path from the current working directory.
|
If <code>CONFIG_LIB_ENVPATH</code> is defined in the configuration, then this may be a relative path from the current working directory.
|
||||||
Otherwise, <code>path</code> must be the absolute path to the program.
|
Otherwise, <code>path</code> must be the absolute path to the program.
|
||||||
<li>
|
<li>
|
||||||
</li>
|
</li>
|
||||||
@ -1013,7 +1013,7 @@ int execl(FAR const char *path, ...);
|
|||||||
<li>
|
<li>
|
||||||
<code>path</code>:
|
<code>path</code>:
|
||||||
The path to the program to be executed.
|
The path to the program to be executed.
|
||||||
If <code>CONFIG_BINFMT_EXEPATH</code> is defined in the configuration, then this may be a relative path from the current working directory.
|
If <code>CONFIG_LIB_ENVPATH</code> is defined in the configuration, then this may be a relative path from the current working directory.
|
||||||
Otherwise, <code>path</code> must be the absolute path to the program.
|
Otherwise, <code>path</code> must be the absolute path to the program.
|
||||||
<li>
|
<li>
|
||||||
</li>
|
</li>
|
||||||
@ -1074,7 +1074,7 @@ int posix_spawnp(FAR pid_t *pid, FAR const char *file,
|
|||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
NOTE: NuttX provides only one implementation:
|
NOTE: NuttX provides only one implementation:
|
||||||
If <code>CONFIG_BINFMT_EXEPATH</code> is defined, then only <code>posix_spawnp()</code> behavior is supported; otherwise, only <code>posix_spawn</code> behavior is supported.
|
If <code>CONFIG_LIB_ENVPATH</code> is defined, then only <code>posix_spawnp()</code> behavior is supported; otherwise, only <code>posix_spawn</code> behavior is supported.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<p>
|
<p>
|
||||||
@ -1156,8 +1156,8 @@ int posix_spawnp(FAR pid_t *pid, FAR const char *file,
|
|||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
NuttX provides only <code>posix_spawn()</code> or <code>posix_spawnp()</code> behavior depending upon the setting of <code>CONFIG_BINFMT_EXEPATH</code>:
|
NuttX provides only <code>posix_spawn()</code> or <code>posix_spawnp()</code> behavior depending upon the setting of <code>CONFIG_LIB_ENVPATH</code>:
|
||||||
If <code>CONFIG_BINFMT_EXEPATH</code> is defined, then only <code>posix_spawnp()</code> behavior is supported; otherwise, only <code>posix_spawn()</code> behavior is supported.
|
If <code>CONFIG_LIB_ENVPATH</code> is defined, then only <code>posix_spawnp()</code> behavior is supported; otherwise, only <code>posix_spawn()</code> behavior is supported.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
The <code>envp</code> argument is not used and the <code>environ</code> variable is not altered (NuttX does not support the <code>environ</code> variable).
|
The <code>envp</code> argument is not used and the <code>environ</code> variable is not altered (NuttX does not support the <code>environ</code> variable).
|
||||||
|
@ -12,18 +12,10 @@ config BINFMT_DISABLE
|
|||||||
|
|
||||||
if !BINFMT_DISABLE
|
if !BINFMT_DISABLE
|
||||||
|
|
||||||
config BINFMT_EXEPATH
|
|
||||||
bool "Support PATH variable"
|
|
||||||
default n
|
|
||||||
depends on !DISABLE_ENVIRON
|
|
||||||
---help---
|
|
||||||
Use the contents of the PATH environment variable to locate executable
|
|
||||||
files. Default: n
|
|
||||||
|
|
||||||
config PATH_INITIAL
|
config PATH_INITIAL
|
||||||
string "Initial PATH Value"
|
string "Initial PATH Value"
|
||||||
default ""
|
default ""
|
||||||
depends on BINFMT_EXEPATH
|
depends on LIB_ENVPATH
|
||||||
---help---
|
---help---
|
||||||
The initial value of the PATH variable. This is the colon-separated
|
The initial value of the PATH variable. This is the colon-separated
|
||||||
list of absolute paths. E.g., "/bin:/usr/bin:/sbin"
|
list of absolute paths. E.g., "/bin:/usr/bin:/sbin"
|
||||||
|
@ -49,10 +49,6 @@ BINFMT_CSRCS = binfmt_globals.c binfmt_initialize.c binfmt_register.c binfmt_un
|
|||||||
BINFMT_CSRCS += binfmt_loadmodule.c binfmt_unloadmodule.c binfmt_execmodule.c
|
BINFMT_CSRCS += binfmt_loadmodule.c binfmt_unloadmodule.c binfmt_execmodule.c
|
||||||
BINFMT_CSRCS += binfmt_exec.c binfmt_copyargv.c binfmt_dumpmodule.c
|
BINFMT_CSRCS += binfmt_exec.c binfmt_copyargv.c binfmt_dumpmodule.c
|
||||||
|
|
||||||
ifeq ($(CONFIG_BINFMT_EXEPATH),y)
|
|
||||||
BINFMT_CSRCS += binfmt_exepath.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_BINFMT_LOADABLE),y)
|
ifeq ($(CONFIG_BINFMT_LOADABLE),y)
|
||||||
BINFMT_CSRCS += binfmt_exit.c
|
BINFMT_CSRCS += binfmt_exit.c
|
||||||
endif
|
endif
|
||||||
|
@ -98,7 +98,7 @@
|
|||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* filename - The path to the program to be executed. If
|
* filename - The path to the program to be executed. If
|
||||||
* CONFIG_BINFMT_EXEPATH is defined in the configuration, then
|
* CONFIG_LIB_ENVPATH is defined in the configuration, then
|
||||||
* this may be a relative path from the current working
|
* this may be a relative path from the current working
|
||||||
* directory. Otherwise, path must be the absolute path to the
|
* directory. Otherwise, path must be the absolute path to the
|
||||||
* program.
|
* program.
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
#include <nuttx/envpath.h>
|
||||||
#include <nuttx/sched.h>
|
#include <nuttx/sched.h>
|
||||||
#include <nuttx/kmalloc.h>
|
#include <nuttx/kmalloc.h>
|
||||||
#include <nuttx/binfmt/binfmt.h>
|
#include <nuttx/binfmt/binfmt.h>
|
||||||
@ -190,12 +191,12 @@ int load_module(FAR struct binary_s *bin)
|
|||||||
* be loaded? Absolute paths start with '/'.
|
* be loaded? Absolute paths start with '/'.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef CONFIG_BINFMT_EXEPATH
|
#ifdef CONFIG_LIB_ENVPATH
|
||||||
if (bin->filename[0] != '/')
|
if (bin->filename[0] != '/')
|
||||||
{
|
{
|
||||||
FAR const char *relpath;
|
FAR const char *relpath;
|
||||||
FAR char *fullpath;
|
FAR char *fullpath;
|
||||||
EXEPATH_HANDLE handle;
|
ENVPATH_HANDLE handle;
|
||||||
|
|
||||||
/* Set aside the relative path */
|
/* Set aside the relative path */
|
||||||
|
|
||||||
@ -204,12 +205,12 @@ int load_module(FAR struct binary_s *bin)
|
|||||||
|
|
||||||
/* Initialize to traverse the PATH variable */
|
/* Initialize to traverse the PATH variable */
|
||||||
|
|
||||||
handle = exepath_init();
|
handle = envpath_init("PATH");
|
||||||
if (handle)
|
if (handle)
|
||||||
{
|
{
|
||||||
/* Get the next absolute file path */
|
/* Get the next absolute file path */
|
||||||
|
|
||||||
while ((fullpath = exepath_next(handle, relpath)) != NULL)
|
while ((fullpath = envpath_next(handle, relpath)) != NULL)
|
||||||
{
|
{
|
||||||
/* Try to load the file at this path */
|
/* Try to load the file at this path */
|
||||||
|
|
||||||
@ -230,7 +231,7 @@ int load_module(FAR struct binary_s *bin)
|
|||||||
|
|
||||||
/* Release the traversal handle */
|
/* Release the traversal handle */
|
||||||
|
|
||||||
exepath_release(handle);
|
envpath_release(handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Restore the relative path. This is not needed for anything
|
/* Restore the relative path. This is not needed for anything
|
||||||
|
@ -71,7 +71,7 @@ Here is a simple test configuration using the NuttX simulator:
|
|||||||
This enables general BINFMT support:
|
This enables general BINFMT support:
|
||||||
|
|
||||||
CONFIG_DEBUG_BINFMT=y
|
CONFIG_DEBUG_BINFMT=y
|
||||||
CONFIG_BINFMT_EXEPATH=y
|
CONFIG_LIB_ENVPATH=y
|
||||||
|
|
||||||
This enables building of the P-Code virtual machine:
|
This enables building of the P-Code virtual machine:
|
||||||
|
|
||||||
|
@ -276,7 +276,7 @@ static int pcode_mount_testfs(void)
|
|||||||
* the ROMFS mountpoint.
|
* the ROMFS mountpoint.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(CONFIG_BINFMT_EXEPATH) && !defined(CONFIG_PATH_INITIAL)
|
#if defined(CONFIG_LIB_ENVPATH) && !defined(CONFIG_PATH_INITIAL)
|
||||||
(void)setenv("PATH", CONFIG_BINFMT_PCODE_TEST_MOUNTPOINT, 1);
|
(void)setenv("PATH", CONFIG_BINFMT_PCODE_TEST_MOUNTPOINT, 1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -7,7 +7,6 @@ CONFIG_ARCH_FLOAT_H=y
|
|||||||
CONFIG_ARCH_INTERRUPTSTACK=2048
|
CONFIG_ARCH_INTERRUPTSTACK=2048
|
||||||
CONFIG_ARCH_STDARG_H=y
|
CONFIG_ARCH_STDARG_H=y
|
||||||
CONFIG_BINFMT_CONSTRUCTORS=y
|
CONFIG_BINFMT_CONSTRUCTORS=y
|
||||||
CONFIG_BINFMT_EXEPATH=y
|
|
||||||
CONFIG_BOARD_INITIALIZE=y
|
CONFIG_BOARD_INITIALIZE=y
|
||||||
CONFIG_BOARD_LOOPSPERMSEC=12061
|
CONFIG_BOARD_LOOPSPERMSEC=12061
|
||||||
CONFIG_C99_BOOL8=y
|
CONFIG_C99_BOOL8=y
|
||||||
@ -26,6 +25,7 @@ CONFIG_INTELHEX_BINARY=y
|
|||||||
CONFIG_LC823450_UART0=y
|
CONFIG_LC823450_UART0=y
|
||||||
CONFIG_LIBM=y
|
CONFIG_LIBM=y
|
||||||
CONFIG_LIB_BOARDCTL=y
|
CONFIG_LIB_BOARDCTL=y
|
||||||
|
CONFIG_LIB_ENVPATH=y
|
||||||
CONFIG_LIB_KBDCODEC=y
|
CONFIG_LIB_KBDCODEC=y
|
||||||
CONFIG_MAX_TASKS=64
|
CONFIG_MAX_TASKS=64
|
||||||
CONFIG_MAX_WDOGPARMS=2
|
CONFIG_MAX_WDOGPARMS=2
|
||||||
|
@ -18,7 +18,6 @@ CONFIG_AUDIO_EXCLUDE_FFORWARD=y
|
|||||||
CONFIG_AUDIO_EXCLUDE_TONE=y
|
CONFIG_AUDIO_EXCLUDE_TONE=y
|
||||||
CONFIG_AUDIO_I2SCHAR=y
|
CONFIG_AUDIO_I2SCHAR=y
|
||||||
CONFIG_AUDIO_WM8776=y
|
CONFIG_AUDIO_WM8776=y
|
||||||
CONFIG_BINFMT_EXEPATH=y
|
|
||||||
CONFIG_BOARDCTL_RESET=y
|
CONFIG_BOARDCTL_RESET=y
|
||||||
CONFIG_BOARDCTL_USBDEVCTRL=y
|
CONFIG_BOARDCTL_USBDEVCTRL=y
|
||||||
CONFIG_BOARD_LOOPSPERMSEC=12061
|
CONFIG_BOARD_LOOPSPERMSEC=12061
|
||||||
@ -71,6 +70,7 @@ CONFIG_LCD=y
|
|||||||
CONFIG_LCD_ST7565=y
|
CONFIG_LCD_ST7565=y
|
||||||
CONFIG_LIBC_EXECFUNCS=y
|
CONFIG_LIBC_EXECFUNCS=y
|
||||||
CONFIG_LIBM=y
|
CONFIG_LIBM=y
|
||||||
|
CONFIG_LIB_ENVPATH=y
|
||||||
CONFIG_LIB_KBDCODEC=y
|
CONFIG_LIB_KBDCODEC=y
|
||||||
CONFIG_MAX_TASKS=64
|
CONFIG_MAX_TASKS=64
|
||||||
CONFIG_MAX_WDOGPARMS=2
|
CONFIG_MAX_WDOGPARMS=2
|
||||||
|
@ -6,7 +6,6 @@ CONFIG_ARCH_CHIP_LC823450=y
|
|||||||
CONFIG_ARCH_FLOAT_H=y
|
CONFIG_ARCH_FLOAT_H=y
|
||||||
CONFIG_ARCH_INTERRUPTSTACK=2048
|
CONFIG_ARCH_INTERRUPTSTACK=2048
|
||||||
CONFIG_ARCH_STDARG_H=y
|
CONFIG_ARCH_STDARG_H=y
|
||||||
CONFIG_BINFMT_EXEPATH=y
|
|
||||||
CONFIG_BOARDCTL_APP_SYMTAB=y
|
CONFIG_BOARDCTL_APP_SYMTAB=y
|
||||||
CONFIG_BOARD_LOOPSPERMSEC=12061
|
CONFIG_BOARD_LOOPSPERMSEC=12061
|
||||||
CONFIG_C99_BOOL8=y
|
CONFIG_C99_BOOL8=y
|
||||||
@ -25,6 +24,7 @@ CONFIG_LC823450_UART0=y
|
|||||||
CONFIG_LIBC_EXECFUNCS=y
|
CONFIG_LIBC_EXECFUNCS=y
|
||||||
CONFIG_LIBM=y
|
CONFIG_LIBM=y
|
||||||
CONFIG_LIB_BOARDCTL=y
|
CONFIG_LIB_BOARDCTL=y
|
||||||
|
CONFIG_LIB_ENVPATH=y
|
||||||
CONFIG_LIB_KBDCODEC=y
|
CONFIG_LIB_KBDCODEC=y
|
||||||
CONFIG_MAX_TASKS=64
|
CONFIG_MAX_TASKS=64
|
||||||
CONFIG_MAX_WDOGPARMS=2
|
CONFIG_MAX_WDOGPARMS=2
|
||||||
|
@ -17,7 +17,6 @@ CONFIG_AUDIO_EXCLUDE_FFORWARD=y
|
|||||||
CONFIG_AUDIO_EXCLUDE_TONE=y
|
CONFIG_AUDIO_EXCLUDE_TONE=y
|
||||||
CONFIG_AUDIO_I2SCHAR=y
|
CONFIG_AUDIO_I2SCHAR=y
|
||||||
CONFIG_AUDIO_WM8776=y
|
CONFIG_AUDIO_WM8776=y
|
||||||
CONFIG_BINFMT_EXEPATH=y
|
|
||||||
CONFIG_BOARDCTL_RESET=y
|
CONFIG_BOARDCTL_RESET=y
|
||||||
CONFIG_BOARDCTL_USBDEVCTRL=y
|
CONFIG_BOARDCTL_USBDEVCTRL=y
|
||||||
CONFIG_BOARD_LOOPSPERMSEC=12061
|
CONFIG_BOARD_LOOPSPERMSEC=12061
|
||||||
@ -69,6 +68,7 @@ CONFIG_LCD=y
|
|||||||
CONFIG_LCD_ST7565=y
|
CONFIG_LCD_ST7565=y
|
||||||
CONFIG_LIBC_EXECFUNCS=y
|
CONFIG_LIBC_EXECFUNCS=y
|
||||||
CONFIG_LIBM=y
|
CONFIG_LIBM=y
|
||||||
|
CONFIG_LIB_ENVPATH=y
|
||||||
CONFIG_LIB_KBDCODEC=y
|
CONFIG_LIB_KBDCODEC=y
|
||||||
CONFIG_MAX_TASKS=64
|
CONFIG_MAX_TASKS=64
|
||||||
CONFIG_MAX_WDOGPARMS=2
|
CONFIG_MAX_WDOGPARMS=2
|
||||||
|
@ -8,7 +8,6 @@ CONFIG_ARCH_STACKDUMP=y
|
|||||||
CONFIG_ARMV7M_USEBASEPRI=y
|
CONFIG_ARMV7M_USEBASEPRI=y
|
||||||
CONFIG_ARM_MPU=y
|
CONFIG_ARM_MPU=y
|
||||||
CONFIG_BINFMT_CONSTRUCTORS=y
|
CONFIG_BINFMT_CONSTRUCTORS=y
|
||||||
CONFIG_BINFMT_EXEPATH=y
|
|
||||||
CONFIG_BOARD_INITIALIZE=y
|
CONFIG_BOARD_INITIALIZE=y
|
||||||
CONFIG_BOARD_INITTHREAD=y
|
CONFIG_BOARD_INITTHREAD=y
|
||||||
CONFIG_BOARD_LOOPSPERMSEC=16717
|
CONFIG_BOARD_LOOPSPERMSEC=16717
|
||||||
@ -24,6 +23,7 @@ CONFIG_FAT_LFN=y
|
|||||||
CONFIG_FS_FAT=y
|
CONFIG_FS_FAT=y
|
||||||
CONFIG_HAVE_CXX=y
|
CONFIG_HAVE_CXX=y
|
||||||
CONFIG_INTELHEX_BINARY=y
|
CONFIG_INTELHEX_BINARY=y
|
||||||
|
CONFIG_LIB_ENVPATH=y
|
||||||
CONFIG_MAX_TASKS=16
|
CONFIG_MAX_TASKS=16
|
||||||
CONFIG_MAX_WDOGPARMS=2
|
CONFIG_MAX_WDOGPARMS=2
|
||||||
CONFIG_MM_KERNEL_HEAPSIZE=16384
|
CONFIG_MM_KERNEL_HEAPSIZE=16384
|
||||||
|
@ -3,7 +3,6 @@ CONFIG_ARCH="sim"
|
|||||||
CONFIG_ARCH_BOARD="sim"
|
CONFIG_ARCH_BOARD="sim"
|
||||||
CONFIG_ARCH_BOARD_SIM=y
|
CONFIG_ARCH_BOARD_SIM=y
|
||||||
CONFIG_ARCH_SIM=y
|
CONFIG_ARCH_SIM=y
|
||||||
CONFIG_BINFMT_EXEPATH=y
|
|
||||||
CONFIG_BOARD_LOOPSPERMSEC=0
|
CONFIG_BOARD_LOOPSPERMSEC=0
|
||||||
CONFIG_BOOT_RUNFROMEXTSRAM=y
|
CONFIG_BOOT_RUNFROMEXTSRAM=y
|
||||||
CONFIG_BUILTIN=y
|
CONFIG_BUILTIN=y
|
||||||
@ -18,6 +17,7 @@ CONFIG_IDLETHREAD_STACKSIZE=4096
|
|||||||
CONFIG_INTERPRETERS_BAS=y
|
CONFIG_INTERPRETERS_BAS=y
|
||||||
CONFIG_LIBC_EXECFUNCS=y
|
CONFIG_LIBC_EXECFUNCS=y
|
||||||
CONFIG_LIBM=y
|
CONFIG_LIBM=y
|
||||||
|
CONFIG_LIB_ENVPATH=y
|
||||||
CONFIG_MAX_TASKS=64
|
CONFIG_MAX_TASKS=64
|
||||||
CONFIG_NFILE_DESCRIPTORS=32
|
CONFIG_NFILE_DESCRIPTORS=32
|
||||||
CONFIG_NSH_ARCHINIT=y
|
CONFIG_NSH_ARCHINIT=y
|
||||||
|
@ -7,7 +7,6 @@ CONFIG_ARCH="sim"
|
|||||||
CONFIG_ARCH_BOARD="sim"
|
CONFIG_ARCH_BOARD="sim"
|
||||||
CONFIG_ARCH_BOARD_SIM=y
|
CONFIG_ARCH_BOARD_SIM=y
|
||||||
CONFIG_ARCH_SIM=y
|
CONFIG_ARCH_SIM=y
|
||||||
CONFIG_BINFMT_EXEPATH=y
|
|
||||||
CONFIG_BLUETOOTH_MAX_CONN=2
|
CONFIG_BLUETOOTH_MAX_CONN=2
|
||||||
CONFIG_BLUETOOTH_MAX_PAIRED=2
|
CONFIG_BLUETOOTH_MAX_PAIRED=2
|
||||||
CONFIG_BLUETOOTH_NULL=y
|
CONFIG_BLUETOOTH_NULL=y
|
||||||
@ -34,6 +33,7 @@ CONFIG_FS_PROCFS=y
|
|||||||
CONFIG_FS_ROMFS=y
|
CONFIG_FS_ROMFS=y
|
||||||
CONFIG_IDLETHREAD_STACKSIZE=4096
|
CONFIG_IDLETHREAD_STACKSIZE=4096
|
||||||
CONFIG_LIBC_EXECFUNCS=y
|
CONFIG_LIBC_EXECFUNCS=y
|
||||||
|
CONFIG_LIB_ENVPATH=y
|
||||||
CONFIG_MAX_TASKS=64
|
CONFIG_MAX_TASKS=64
|
||||||
CONFIG_NET=y
|
CONFIG_NET=y
|
||||||
CONFIG_NETDEVICES=y
|
CONFIG_NETDEVICES=y
|
||||||
|
@ -8,7 +8,6 @@ CONFIG_ARCH="sim"
|
|||||||
CONFIG_ARCH_BOARD="sim"
|
CONFIG_ARCH_BOARD="sim"
|
||||||
CONFIG_ARCH_BOARD_SIM=y
|
CONFIG_ARCH_BOARD_SIM=y
|
||||||
CONFIG_ARCH_SIM=y
|
CONFIG_ARCH_SIM=y
|
||||||
CONFIG_BINFMT_EXEPATH=y
|
|
||||||
CONFIG_BOARDCTL_POWEROFF=y
|
CONFIG_BOARDCTL_POWEROFF=y
|
||||||
CONFIG_BOARD_LOOPSPERMSEC=0
|
CONFIG_BOARD_LOOPSPERMSEC=0
|
||||||
CONFIG_BOOT_RUNFROMEXTSRAM=y
|
CONFIG_BOOT_RUNFROMEXTSRAM=y
|
||||||
@ -28,6 +27,7 @@ CONFIG_FS_PROCFS=y
|
|||||||
CONFIG_FS_ROMFS=y
|
CONFIG_FS_ROMFS=y
|
||||||
CONFIG_IDLETHREAD_STACKSIZE=4096
|
CONFIG_IDLETHREAD_STACKSIZE=4096
|
||||||
CONFIG_LIBC_EXECFUNCS=y
|
CONFIG_LIBC_EXECFUNCS=y
|
||||||
|
CONFIG_LIB_ENVPATH=y
|
||||||
CONFIG_MAX_TASKS=64
|
CONFIG_MAX_TASKS=64
|
||||||
CONFIG_NET=y
|
CONFIG_NET=y
|
||||||
CONFIG_NETDEVICES=y
|
CONFIG_NETDEVICES=y
|
||||||
|
@ -2,7 +2,6 @@ CONFIG_ARCH="sim"
|
|||||||
CONFIG_ARCH_BOARD="sim"
|
CONFIG_ARCH_BOARD="sim"
|
||||||
CONFIG_ARCH_BOARD_SIM=y
|
CONFIG_ARCH_BOARD_SIM=y
|
||||||
CONFIG_ARCH_SIM=y
|
CONFIG_ARCH_SIM=y
|
||||||
CONFIG_BINFMT_EXEPATH=y
|
|
||||||
CONFIG_BOARDCTL_APP_SYMTAB=y
|
CONFIG_BOARDCTL_APP_SYMTAB=y
|
||||||
CONFIG_BOARDCTL_POWEROFF=y
|
CONFIG_BOARDCTL_POWEROFF=y
|
||||||
CONFIG_BOARD_INITIALIZE=y
|
CONFIG_BOARD_INITIALIZE=y
|
||||||
@ -26,6 +25,7 @@ CONFIG_INIT_MOUNT_FSTYPE="hostfs"
|
|||||||
CONFIG_INIT_MOUNT_SOURCE=""
|
CONFIG_INIT_MOUNT_SOURCE=""
|
||||||
CONFIG_INIT_MOUNT_TARGET="/system"
|
CONFIG_INIT_MOUNT_TARGET="/system"
|
||||||
CONFIG_LIBC_EXECFUNCS=y
|
CONFIG_LIBC_EXECFUNCS=y
|
||||||
|
CONFIG_LIB_ENVPATH=y
|
||||||
CONFIG_MEMSET_OPTSPEED=y
|
CONFIG_MEMSET_OPTSPEED=y
|
||||||
CONFIG_NSH_ARCHINIT=y
|
CONFIG_NSH_ARCHINIT=y
|
||||||
CONFIG_NSH_BUILTIN_APPS=y
|
CONFIG_NSH_BUILTIN_APPS=y
|
||||||
|
@ -4,7 +4,6 @@ CONFIG_ARCH="sim"
|
|||||||
CONFIG_ARCH_BOARD="sim"
|
CONFIG_ARCH_BOARD="sim"
|
||||||
CONFIG_ARCH_BOARD_SIM=y
|
CONFIG_ARCH_BOARD_SIM=y
|
||||||
CONFIG_ARCH_SIM=y
|
CONFIG_ARCH_SIM=y
|
||||||
CONFIG_BINFMT_EXEPATH=y
|
|
||||||
CONFIG_BOARDCTL_POWEROFF=y
|
CONFIG_BOARDCTL_POWEROFF=y
|
||||||
CONFIG_BOARD_LOOPSPERMSEC=0
|
CONFIG_BOARD_LOOPSPERMSEC=0
|
||||||
CONFIG_BOOT_RUNFROMEXTSRAM=y
|
CONFIG_BOOT_RUNFROMEXTSRAM=y
|
||||||
@ -27,6 +26,7 @@ CONFIG_INTERPRETERS_MINIBASIC=y
|
|||||||
CONFIG_INTERPRETER_MINIBASIC_TESTSCRIPT=y
|
CONFIG_INTERPRETER_MINIBASIC_TESTSCRIPT=y
|
||||||
CONFIG_LIBC_EXECFUNCS=y
|
CONFIG_LIBC_EXECFUNCS=y
|
||||||
CONFIG_LIBM=y
|
CONFIG_LIBM=y
|
||||||
|
CONFIG_LIB_ENVPATH=y
|
||||||
CONFIG_MAX_TASKS=64
|
CONFIG_MAX_TASKS=64
|
||||||
CONFIG_NFILE_DESCRIPTORS=32
|
CONFIG_NFILE_DESCRIPTORS=32
|
||||||
CONFIG_NSH_ARCHINIT=y
|
CONFIG_NSH_ARCHINIT=y
|
||||||
|
@ -4,7 +4,6 @@ CONFIG_ARCH="sim"
|
|||||||
CONFIG_ARCH_BOARD="sim"
|
CONFIG_ARCH_BOARD="sim"
|
||||||
CONFIG_ARCH_BOARD_SIM=y
|
CONFIG_ARCH_BOARD_SIM=y
|
||||||
CONFIG_ARCH_SIM=y
|
CONFIG_ARCH_SIM=y
|
||||||
CONFIG_BINFMT_EXEPATH=y
|
|
||||||
CONFIG_BOARDCTL_APP_SYMTAB=y
|
CONFIG_BOARDCTL_APP_SYMTAB=y
|
||||||
CONFIG_BOARDCTL_POWEROFF=y
|
CONFIG_BOARDCTL_POWEROFF=y
|
||||||
CONFIG_BOARD_LOOPSPERMSEC=0
|
CONFIG_BOARD_LOOPSPERMSEC=0
|
||||||
@ -26,6 +25,7 @@ CONFIG_FS_PROCFS=y
|
|||||||
CONFIG_FS_ROMFS=y
|
CONFIG_FS_ROMFS=y
|
||||||
CONFIG_IDLETHREAD_STACKSIZE=4096
|
CONFIG_IDLETHREAD_STACKSIZE=4096
|
||||||
CONFIG_LIBC_EXECFUNCS=y
|
CONFIG_LIBC_EXECFUNCS=y
|
||||||
|
CONFIG_LIB_ENVPATH=y
|
||||||
CONFIG_MAX_TASKS=64
|
CONFIG_MAX_TASKS=64
|
||||||
CONFIG_NFILE_DESCRIPTORS=32
|
CONFIG_NFILE_DESCRIPTORS=32
|
||||||
CONFIG_NSH_ARCHINIT=y
|
CONFIG_NSH_ARCHINIT=y
|
||||||
|
@ -6,7 +6,6 @@ CONFIG_ARCH="sim"
|
|||||||
CONFIG_ARCH_BOARD="sim"
|
CONFIG_ARCH_BOARD="sim"
|
||||||
CONFIG_ARCH_BOARD_SIM=y
|
CONFIG_ARCH_BOARD_SIM=y
|
||||||
CONFIG_ARCH_SIM=y
|
CONFIG_ARCH_SIM=y
|
||||||
CONFIG_BINFMT_EXEPATH=y
|
|
||||||
CONFIG_BOARD_LOOPSPERMSEC=0
|
CONFIG_BOARD_LOOPSPERMSEC=0
|
||||||
CONFIG_BOOT_RUNFROMEXTSRAM=y
|
CONFIG_BOOT_RUNFROMEXTSRAM=y
|
||||||
CONFIG_BUILTIN=y
|
CONFIG_BUILTIN=y
|
||||||
@ -23,6 +22,7 @@ CONFIG_FS_PROCFS=y
|
|||||||
CONFIG_FS_ROMFS=y
|
CONFIG_FS_ROMFS=y
|
||||||
CONFIG_IDLETHREAD_STACKSIZE=8192
|
CONFIG_IDLETHREAD_STACKSIZE=8192
|
||||||
CONFIG_LIBC_EXECFUNCS=y
|
CONFIG_LIBC_EXECFUNCS=y
|
||||||
|
CONFIG_LIB_ENVPATH=y
|
||||||
CONFIG_MAX_TASKS=64
|
CONFIG_MAX_TASKS=64
|
||||||
CONFIG_NET=y
|
CONFIG_NET=y
|
||||||
CONFIG_NET_LOCAL=y
|
CONFIG_NET_LOCAL=y
|
||||||
|
@ -3,7 +3,6 @@ CONFIG_ARCH="sim"
|
|||||||
CONFIG_ARCH_BOARD="sim"
|
CONFIG_ARCH_BOARD="sim"
|
||||||
CONFIG_ARCH_BOARD_SIM=y
|
CONFIG_ARCH_BOARD_SIM=y
|
||||||
CONFIG_ARCH_SIM=y
|
CONFIG_ARCH_SIM=y
|
||||||
CONFIG_BINFMT_EXEPATH=y
|
|
||||||
CONFIG_BOARD_LOOPSPERMSEC=0
|
CONFIG_BOARD_LOOPSPERMSEC=0
|
||||||
CONFIG_BOOT_RUNFROMEXTSRAM=y
|
CONFIG_BOOT_RUNFROMEXTSRAM=y
|
||||||
CONFIG_BUILTIN=y
|
CONFIG_BUILTIN=y
|
||||||
@ -20,6 +19,7 @@ CONFIG_FS_ROMFS=y
|
|||||||
CONFIG_FS_UNIONFS=y
|
CONFIG_FS_UNIONFS=y
|
||||||
CONFIG_IDLETHREAD_STACKSIZE=4096
|
CONFIG_IDLETHREAD_STACKSIZE=4096
|
||||||
CONFIG_LIBC_EXECFUNCS=y
|
CONFIG_LIBC_EXECFUNCS=y
|
||||||
|
CONFIG_LIB_ENVPATH=y
|
||||||
CONFIG_MAX_TASKS=64
|
CONFIG_MAX_TASKS=64
|
||||||
CONFIG_NFILE_DESCRIPTORS=32
|
CONFIG_NFILE_DESCRIPTORS=32
|
||||||
CONFIG_NSH_ARCHINIT=y
|
CONFIG_NSH_ARCHINIT=y
|
||||||
|
@ -6,7 +6,6 @@ CONFIG_ARCH="sim"
|
|||||||
CONFIG_ARCH_BOARD="sim"
|
CONFIG_ARCH_BOARD="sim"
|
||||||
CONFIG_ARCH_BOARD_SIM=y
|
CONFIG_ARCH_BOARD_SIM=y
|
||||||
CONFIG_ARCH_SIM=y
|
CONFIG_ARCH_SIM=y
|
||||||
CONFIG_BINFMT_EXEPATH=y
|
|
||||||
CONFIG_BOARDCTL_POWEROFF=y
|
CONFIG_BOARDCTL_POWEROFF=y
|
||||||
CONFIG_BOARD_LOOPSPERMSEC=0
|
CONFIG_BOARD_LOOPSPERMSEC=0
|
||||||
CONFIG_BOOT_RUNFROMEXTSRAM=y
|
CONFIG_BOOT_RUNFROMEXTSRAM=y
|
||||||
@ -28,6 +27,7 @@ CONFIG_FS_ROMFS=y
|
|||||||
CONFIG_FS_USERFS=y
|
CONFIG_FS_USERFS=y
|
||||||
CONFIG_IDLETHREAD_STACKSIZE=4096
|
CONFIG_IDLETHREAD_STACKSIZE=4096
|
||||||
CONFIG_LIBC_EXECFUNCS=y
|
CONFIG_LIBC_EXECFUNCS=y
|
||||||
|
CONFIG_LIB_ENVPATH=y
|
||||||
CONFIG_MAX_TASKS=64
|
CONFIG_MAX_TASKS=64
|
||||||
CONFIG_NET=y
|
CONFIG_NET=y
|
||||||
CONFIG_NETDEVICES=y
|
CONFIG_NETDEVICES=y
|
||||||
|
@ -6,7 +6,6 @@ CONFIG_ARCH="sim"
|
|||||||
CONFIG_ARCH_BOARD="sim"
|
CONFIG_ARCH_BOARD="sim"
|
||||||
CONFIG_ARCH_BOARD_SIM=y
|
CONFIG_ARCH_BOARD_SIM=y
|
||||||
CONFIG_ARCH_SIM=y
|
CONFIG_ARCH_SIM=y
|
||||||
CONFIG_BINFMT_EXEPATH=y
|
|
||||||
CONFIG_BOARDCTL_APP_SYMTAB=y
|
CONFIG_BOARDCTL_APP_SYMTAB=y
|
||||||
CONFIG_BOARD_LOOPSPERMSEC=0
|
CONFIG_BOARD_LOOPSPERMSEC=0
|
||||||
CONFIG_BOOT_RUNFROMEXTSRAM=y
|
CONFIG_BOOT_RUNFROMEXTSRAM=y
|
||||||
@ -23,6 +22,7 @@ CONFIG_FS_PROCFS=y
|
|||||||
CONFIG_FS_ROMFS=y
|
CONFIG_FS_ROMFS=y
|
||||||
CONFIG_IDLETHREAD_STACKSIZE=4096
|
CONFIG_IDLETHREAD_STACKSIZE=4096
|
||||||
CONFIG_LIBC_EXECFUNCS=y
|
CONFIG_LIBC_EXECFUNCS=y
|
||||||
|
CONFIG_LIB_ENVPATH=y
|
||||||
CONFIG_MAX_TASKS=64
|
CONFIG_MAX_TASKS=64
|
||||||
CONFIG_NET=y
|
CONFIG_NET=y
|
||||||
CONFIG_NET_LOCAL=y
|
CONFIG_NET_LOCAL=y
|
||||||
|
@ -7,7 +7,6 @@ CONFIG_ARCH_CHIP_STM32F407VG=y
|
|||||||
CONFIG_ARCH_STACKDUMP=y
|
CONFIG_ARCH_STACKDUMP=y
|
||||||
CONFIG_ARMV7M_USEBASEPRI=y
|
CONFIG_ARMV7M_USEBASEPRI=y
|
||||||
CONFIG_BINFMT_CONSTRUCTORS=y
|
CONFIG_BINFMT_CONSTRUCTORS=y
|
||||||
CONFIG_BINFMT_EXEPATH=y
|
|
||||||
CONFIG_BOARD_INITIALIZE=y
|
CONFIG_BOARD_INITIALIZE=y
|
||||||
CONFIG_BOARD_LOOPSPERMSEC=16717
|
CONFIG_BOARD_LOOPSPERMSEC=16717
|
||||||
CONFIG_DEV_LOWCONSOLE=y
|
CONFIG_DEV_LOWCONSOLE=y
|
||||||
@ -18,6 +17,7 @@ CONFIG_FS_ROMFS=y
|
|||||||
CONFIG_HAVE_CXX=y
|
CONFIG_HAVE_CXX=y
|
||||||
CONFIG_HOST_WINDOWS=y
|
CONFIG_HOST_WINDOWS=y
|
||||||
CONFIG_INTELHEX_BINARY=y
|
CONFIG_INTELHEX_BINARY=y
|
||||||
|
CONFIG_LIB_ENVPATH=y
|
||||||
CONFIG_MAX_TASKS=16
|
CONFIG_MAX_TASKS=16
|
||||||
CONFIG_MAX_WDOGPARMS=2
|
CONFIG_MAX_WDOGPARMS=2
|
||||||
CONFIG_MM_REGIONS=2
|
CONFIG_MM_REGIONS=2
|
||||||
|
@ -6,7 +6,6 @@ CONFIG_ARCH_CHIP_STM32=y
|
|||||||
CONFIG_ARCH_CHIP_STM32F407VG=y
|
CONFIG_ARCH_CHIP_STM32F407VG=y
|
||||||
CONFIG_ARCH_STACKDUMP=y
|
CONFIG_ARCH_STACKDUMP=y
|
||||||
CONFIG_BINFMT_CONSTRUCTORS=y
|
CONFIG_BINFMT_CONSTRUCTORS=y
|
||||||
CONFIG_BINFMT_EXEPATH=y
|
|
||||||
CONFIG_BOARDCTL_APP_SYMTAB=y
|
CONFIG_BOARDCTL_APP_SYMTAB=y
|
||||||
CONFIG_BOARD_LOOPSPERMSEC=16717
|
CONFIG_BOARD_LOOPSPERMSEC=16717
|
||||||
CONFIG_DEV_LOWCONSOLE=y
|
CONFIG_DEV_LOWCONSOLE=y
|
||||||
@ -21,6 +20,7 @@ CONFIG_HOST_WINDOWS=y
|
|||||||
CONFIG_INTELHEX_BINARY=y
|
CONFIG_INTELHEX_BINARY=y
|
||||||
CONFIG_LIBC_EXECFUNCS=y
|
CONFIG_LIBC_EXECFUNCS=y
|
||||||
CONFIG_LIB_BOARDCTL=y
|
CONFIG_LIB_BOARDCTL=y
|
||||||
|
CONFIG_LIB_ENVPATH=y
|
||||||
CONFIG_MAX_TASKS=16
|
CONFIG_MAX_TASKS=16
|
||||||
CONFIG_MAX_WDOGPARMS=2
|
CONFIG_MAX_WDOGPARMS=2
|
||||||
CONFIG_MM_REGIONS=2
|
CONFIG_MM_REGIONS=2
|
||||||
|
@ -58,14 +58,6 @@
|
|||||||
* Public Types
|
* Public Types
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* EXEPATH_HANDLE is an opaque handle used to traverse the absolute paths
|
|
||||||
* assigned to the PATH environment variable.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if !defined(CONFIG_BINFMT_DISABLE) && defined(CONFIG_BINFMT_EXEPATH)
|
|
||||||
typedef FAR void *EXEPATH_HANDLE;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* The type of one C++ constructor or destructor */
|
/* The type of one C++ constructor or destructor */
|
||||||
|
|
||||||
typedef FAR void (*binfmt_ctor_t)(void);
|
typedef FAR void (*binfmt_ctor_t)(void);
|
||||||
@ -74,7 +66,7 @@ typedef FAR void (*binfmt_dtor_t)(void);
|
|||||||
/* This describes the file to be loaded.
|
/* This describes the file to be loaded.
|
||||||
*
|
*
|
||||||
* NOTE 1: The 'filename' must be the full, absolute path to the file to be
|
* NOTE 1: The 'filename' must be the full, absolute path to the file to be
|
||||||
* executed unless CONFIG_BINFMT_EXEPATH is defined. In that case,
|
* executed unless CONFIG_LIB_ENVPATH is defined. In that case,
|
||||||
* 'filename' may be a relative path; a set of candidate absolute paths
|
* 'filename' may be a relative path; a set of candidate absolute paths
|
||||||
* will be generated using the PATH environment variable and load_module()
|
* will be generated using the PATH environment variable and load_module()
|
||||||
* will attempt to load each file that is found at those absolute paths.
|
* will attempt to load each file that is found at those absolute paths.
|
||||||
@ -300,7 +292,7 @@ int exec_module(FAR const struct binary_s *bin);
|
|||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* filename - The path to the program to be executed. If
|
* filename - The path to the program to be executed. If
|
||||||
* CONFIG_BINFMT_EXEPATH is defined in the configuration, then
|
* CONFIG_LIB_ENVPATH is defined in the configuration, then
|
||||||
* this may be a relative path from the current working
|
* this may be a relative path from the current working
|
||||||
* directory. Otherwise, path must be the absolute path to the
|
* directory. Otherwise, path must be the absolute path to the
|
||||||
* program.
|
* program.
|
||||||
@ -345,89 +337,6 @@ int exec(FAR const char *filename, FAR char * const *argv,
|
|||||||
int binfmt_exit(FAR struct binary_s *bin);
|
int binfmt_exit(FAR struct binary_s *bin);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Name: exepath_init
|
|
||||||
*
|
|
||||||
* Description:
|
|
||||||
* Initialize for the traversal of each value in the PATH variable. The
|
|
||||||
* usage is sequence is as follows:
|
|
||||||
*
|
|
||||||
* 1) Call exepath_init() to initialize for the traversal. exepath_init()
|
|
||||||
* will return an opaque handle that can then be provided to
|
|
||||||
* exepath_next() and exepath_release().
|
|
||||||
* 2) Call exepath_next() repeatedly to examine every file that lies
|
|
||||||
* in the directories of the PATH variable
|
|
||||||
* 3) Call exepath_release() to free resources set aside by exepath_init().
|
|
||||||
*
|
|
||||||
* Input Parameters:
|
|
||||||
* None
|
|
||||||
*
|
|
||||||
* Returned Value:
|
|
||||||
* On success, exepath_init() return a non-NULL, opaque handle that may
|
|
||||||
* subsequently be used in calls to exepath_next() and exepath_release().
|
|
||||||
* On error, a NULL handle value will be returned. The most likely cause
|
|
||||||
* of an error would be that there is no value associated with the PATH
|
|
||||||
* variable.
|
|
||||||
*
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#if !defined(CONFIG_BINFMT_DISABLE) && defined(CONFIG_BINFMT_EXEPATH)
|
|
||||||
EXEPATH_HANDLE exepath_init(void);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Name: exepath_next
|
|
||||||
*
|
|
||||||
* Description:
|
|
||||||
* Traverse all possible values in the PATH variable in attempt to find
|
|
||||||
* the full path to an executable file when only a relative path is
|
|
||||||
* provided.
|
|
||||||
*
|
|
||||||
* Input Parameters:
|
|
||||||
* handle - The handle value returned by exepath_init
|
|
||||||
* relpath - The relative path to the file to be found.
|
|
||||||
*
|
|
||||||
* Returned Value:
|
|
||||||
* On success, a non-NULL pointer to a null-terminated string is provided.
|
|
||||||
* This is the full path to a file that exists in the file system. This
|
|
||||||
* function will verify that the file exists (but will not verify that it
|
|
||||||
* is marked executable).
|
|
||||||
*
|
|
||||||
* NOTE: The string pointer return in the success case points to allocated
|
|
||||||
* memory. This memory must be freed by the called by calling kmm_free().
|
|
||||||
*
|
|
||||||
* NULL is returned if no path is found to any file with the provided
|
|
||||||
* 'relpath' from any absolute path in the PATH variable. In this case,
|
|
||||||
* there is no point in calling exepath_next() further; exepath_release()
|
|
||||||
* must be called to release resources set aside by expath_init().
|
|
||||||
*
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#if !defined(CONFIG_BINFMT_DISABLE) && defined(CONFIG_BINFMT_EXEPATH)
|
|
||||||
FAR char *exepath_next(EXEPATH_HANDLE handle, FAR const char *relpath);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Name: exepath_release
|
|
||||||
*
|
|
||||||
* Description:
|
|
||||||
* Release all resources set aside by exepath_init() when the handle value
|
|
||||||
* was created. The handle value is invalid on return from this function.
|
|
||||||
* Attempts to all exepath_next() or exepath_release() with such a 'stale'
|
|
||||||
* handle will result in undefined (i.e., not good) behavior.
|
|
||||||
*
|
|
||||||
* Input Parameters:
|
|
||||||
* handle - The handle value returned by exepath_init
|
|
||||||
*
|
|
||||||
* Returned Value:
|
|
||||||
* None
|
|
||||||
*
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#if !defined(CONFIG_BINFMT_DISABLE) && defined(CONFIG_BINFMT_EXEPATH)
|
|
||||||
void exepath_release(EXEPATH_HANDLE handle);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#undef EXTERN
|
#undef EXTERN
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
}
|
}
|
||||||
|
159
include/nuttx/envpath.h
Normal file
159
include/nuttx/envpath.h
Normal file
@ -0,0 +1,159 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* include/nuttx/envpath.h
|
||||||
|
*
|
||||||
|
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||||
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in
|
||||||
|
* the documentation and/or other materials provided with the
|
||||||
|
* distribution.
|
||||||
|
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||||
|
* used to endorse or promote products derived from this software
|
||||||
|
* without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef __INCLUDE_NUTTX_ENVPATH_H
|
||||||
|
#define __INCLUDE_NUTTX_ENVPATH_H
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Included Files
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
#ifdef CONFIG_LIB_ENVPATH
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Pre-processor Definitions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Types
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/* ENVPATH_HANDLE is an opaque handle used to traverse the absolute paths
|
||||||
|
* assigned to the PATH environment variable.
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef FAR void *ENVPATH_HANDLE;
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Function Prototypes
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
#define EXTERN extern "C"
|
||||||
|
extern "C"
|
||||||
|
{
|
||||||
|
#else
|
||||||
|
#define EXTERN extern
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: envpath_init
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Initialize for the traversal of each value in the PATH variable. The
|
||||||
|
* usage is sequence is as follows:
|
||||||
|
*
|
||||||
|
* Input Parameters:
|
||||||
|
* name - The variable name of environment to searches path list.
|
||||||
|
*
|
||||||
|
* 1) Call envpath_init() to initialize for the traversal. envpath_init()
|
||||||
|
* will return an opaque handle that can then be provided to
|
||||||
|
* envpath_next() and envpath_release().
|
||||||
|
* 2) Call envpath_next() repeatedly to examine every file that lies
|
||||||
|
* in the directories of the PATH variable
|
||||||
|
* 3) Call envpath_release() to free resources set aside by envpath_init().
|
||||||
|
*
|
||||||
|
* Input Parameters:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Returned Value:
|
||||||
|
* On success, envpath_init() return a non-NULL, opaque handle that may
|
||||||
|
* subsequently be used in calls to envpath_next() and envpath_release().
|
||||||
|
* On error, a NULL handle value will be returned. The most likely cause
|
||||||
|
* of an error would be that there is no value associated with the PATH
|
||||||
|
* variable.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
ENVPATH_HANDLE envpath_init(FAR const char *name);
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: envpath_next
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Traverse all possible values in the PATH variable in attempt to find
|
||||||
|
* the full path to an executable file when only a relative path is
|
||||||
|
* provided.
|
||||||
|
*
|
||||||
|
* Input Parameters:
|
||||||
|
* handle - The handle value returned by envpath_init
|
||||||
|
* relpath - The relative path to the file to be found.
|
||||||
|
*
|
||||||
|
* Returned Value:
|
||||||
|
* On success, a non-NULL pointer to a null-terminated string is provided.
|
||||||
|
* This is the full path to a file that exists in the file system. This
|
||||||
|
* function will verify that the file exists (but will not verify that it
|
||||||
|
* is marked executable).
|
||||||
|
*
|
||||||
|
* NOTE: The string pointer return in the success case points to allocated
|
||||||
|
* memory. This memory must be freed by the called by calling kmm_free().
|
||||||
|
*
|
||||||
|
* NULL is returned if no path is found to any file with the provided
|
||||||
|
* 'relpath' from any absolute path in the PATH variable. In this case,
|
||||||
|
* there is no point in calling envpath_next() further; envpath_release()
|
||||||
|
* must be called to release resources set aside by expath_init().
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
FAR char *envpath_next(ENVPATH_HANDLE handle, FAR const char *relpath);
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: envpath_release
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Release all resources set aside by envpath_init() when the handle value
|
||||||
|
* was created. The handle value is invalid on return from this function.
|
||||||
|
* Attempts to all envpath_next() or envpath_release() with such a 'stale'
|
||||||
|
* handle will result in undefined (i.e., not good) behavior.
|
||||||
|
*
|
||||||
|
* Input Parameters:
|
||||||
|
* handle - The handle value returned by envpath_init
|
||||||
|
*
|
||||||
|
* Returned Value:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
void envpath_release(ENVPATH_HANDLE handle);
|
||||||
|
|
||||||
|
#undef EXTERN
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* CONFIG_LIB_ENVPATH */
|
||||||
|
#endif /* INCLUDE_NUTTX_ENVPATH_H */
|
@ -222,8 +222,6 @@ struct mod_loadinfo_s
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
struct symtab_s;
|
struct symtab_s;
|
||||||
FAR const struct symtab_s *g_modlib_symtab;
|
|
||||||
FAR int g_modlib_nsymbols;
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Function Prototypes
|
* Public Function Prototypes
|
||||||
|
@ -137,7 +137,7 @@ extern "C"
|
|||||||
* file system at 'path'
|
* file system at 'path'
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef CONFIG_BINFMT_EXEPATH
|
#ifdef CONFIG_LIB_ENVPATH
|
||||||
int posix_spawnp(FAR pid_t *pid, FAR const char *path,
|
int posix_spawnp(FAR pid_t *pid, FAR const char *path,
|
||||||
FAR const posix_spawn_file_actions_t *file_actions,
|
FAR const posix_spawn_file_actions_t *file_actions,
|
||||||
FAR const posix_spawnattr_t *attr,
|
FAR const posix_spawnattr_t *attr,
|
||||||
|
@ -200,7 +200,7 @@
|
|||||||
# define __SYS_posix_spawn __SYS_exec
|
# define __SYS_posix_spawn __SYS_exec
|
||||||
# endif
|
# endif
|
||||||
# ifdef CONFIG_LIBC_EXECFUNCS
|
# ifdef CONFIG_LIBC_EXECFUNCS
|
||||||
# ifdef CONFIG_BINFMT_EXEPATH
|
# ifdef CONFIG_LIB_ENVPATH
|
||||||
# define SYS_posix_spawnp __SYS_posix_spawn
|
# define SYS_posix_spawnp __SYS_posix_spawn
|
||||||
# else
|
# else
|
||||||
# define SYS_posix_spawn __SYS_posix_spawn
|
# define SYS_posix_spawn __SYS_posix_spawn
|
||||||
|
@ -102,3 +102,11 @@ config LIB_SLCDCODEC
|
|||||||
include/nuttx/lcd/slcd_codec.h. While not correctly a part of the C
|
include/nuttx/lcd/slcd_codec.h. While not correctly a part of the C
|
||||||
library, it is included here because the encoding side of this
|
library, it is included here because the encoding side of this
|
||||||
interface must be accessible by end user programs.
|
interface must be accessible by end user programs.
|
||||||
|
|
||||||
|
config LIB_ENVPATH
|
||||||
|
bool "Support PATH Environment Variable"
|
||||||
|
default n
|
||||||
|
depends on !DISABLE_ENVIRON
|
||||||
|
---help---
|
||||||
|
Use the contents of the common environment variable to locate executable
|
||||||
|
or library files. Default: n
|
||||||
|
@ -103,6 +103,12 @@ ifeq ($(CONFIG_LIB_SLCDCODEC),y)
|
|||||||
CSRCS += lib_slcdencode.c lib_slcddecode.c
|
CSRCS += lib_slcdencode.c lib_slcddecode.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Environment search path support
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_LIB_ENVPATH),y)
|
||||||
|
CSRCS += lib_envpath.c
|
||||||
|
endif
|
||||||
|
|
||||||
# Add the misc directory to the build
|
# Add the misc directory to the build
|
||||||
|
|
||||||
DEPPATH += --dep-path misc
|
DEPPATH += --dep-path misc
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* binfmt/binfmt_exepath.c
|
* libs/libc/misc/lib_envpath.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2012, 2018 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -47,120 +47,124 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include <nuttx/kmalloc.h>
|
#include <nuttx/envpath.h>
|
||||||
#include <nuttx/binfmt/binfmt.h>
|
|
||||||
|
|
||||||
#if !defined(CONFIG_BINFMT_DISABLE) && defined(CONFIG_BINFMT_EXEPATH)
|
#include "libc.h"
|
||||||
|
|
||||||
|
#if defined(CONFIG_LIB_ENVPATH)
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Types
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
struct exepath_s
|
struct envpath_s
|
||||||
{
|
{
|
||||||
FAR char *next; /* Pointer to the next (unterminated) value in the PATH variable */
|
FAR char *next; /* Pointer to the next (unterminated) value in the PATH variable */
|
||||||
char path[1];
|
char path[1];
|
||||||
};
|
};
|
||||||
#define SIZEOF_EXEPATH_S(n) (sizeof(struct exepath_s) + (n) - 1)
|
|
||||||
|
#define SIZEOF_ENVPATH_S(n) (sizeof(struct envpath_s) + (n) - 1)
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: exepath_init
|
* Name: envpath_init
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Initialize for the traversal of each value in the PATH variable. The
|
* Initialize for the traversal of each value in the PATH variable. The
|
||||||
* usage is sequence is as follows:
|
* usage is sequence is as follows:
|
||||||
*
|
*
|
||||||
* 1) Call exepath_init() to initialize for the traversal. exepath_init()
|
* 1) Call envpath_init() to initialize for the traversal. envpath_init()
|
||||||
* will return an opaque handle that can then be provided to
|
* will return an opaque handle that can then be provided to
|
||||||
* exepath_next() and exepath_release().
|
* envpath_next() and envpath_release().
|
||||||
* 2) Call exepath_next() repeatedly to examine every file that lies
|
* 2) Call envpath_next() repeatedly to examine every file that lies
|
||||||
* in the directories of the PATH variable
|
* in the directories of the PATH variable
|
||||||
* 3) Call exepath_release() to free resources set aside by exepath_init().
|
* 3) Call envpath_release() to free resources set aside by envpath_init().
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
* On success, exepath_init() return a non-NULL, opaque handle that may
|
* On success, envpath_init() return a non-NULL, opaque handle that may
|
||||||
* subsequently be used in calls to exepath_next() and exepath_release().
|
* subsequently be used in calls to envpath_next() and envpath_release().
|
||||||
* On error, a NULL handle value will be returned. The most likely cause
|
* On error, a NULL handle value will be returned. The most likely cause
|
||||||
* of an error would be that there is no value associated with the PATH
|
* of an error would be that there is no value associated with the PATH
|
||||||
* variable.
|
* variable.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
EXEPATH_HANDLE exepath_init(void)
|
ENVPATH_HANDLE envpath_init(FAR const char *name)
|
||||||
{
|
{
|
||||||
FAR struct exepath_s *exepath;
|
FAR struct envpath_s *envpath;
|
||||||
FAR char *path;
|
FAR char *path;
|
||||||
|
|
||||||
/* Get the value of the PATH variable */
|
/* Get the value of the PATH variable */
|
||||||
|
|
||||||
path = getenv("PATH");
|
path = getenv(name);
|
||||||
if (!path)
|
if (!path)
|
||||||
{
|
{
|
||||||
/* getenv() will return a NULL value if the PATH variable does not
|
/* getenv() will return a NULL value if the PATH variable does not
|
||||||
* exist in the environment.
|
* exist in the environment.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return (EXEPATH_HANDLE)NULL;
|
return (ENVPATH_HANDLE)NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Allocate a container for the PATH variable contents */
|
/* Allocate a container for the PATH variable contents */
|
||||||
|
|
||||||
exepath = (FAR struct exepath_s *)kmm_malloc(SIZEOF_EXEPATH_S(strlen(path) + 1));
|
envpath = (FAR struct envpath_s *)
|
||||||
if (!exepath)
|
lib_malloc(SIZEOF_ENVPATH_S(strlen(path) + 1));
|
||||||
|
|
||||||
|
if (!envpath)
|
||||||
{
|
{
|
||||||
/* Ooops.. we are out of memory */
|
/* Ooops.. we are out of memory */
|
||||||
|
|
||||||
return (EXEPATH_HANDLE)NULL;
|
return (ENVPATH_HANDLE)NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Populate the container */
|
/* Populate the container */
|
||||||
|
|
||||||
strcpy(exepath->path, path);
|
strcpy(envpath->path, path);
|
||||||
exepath->next = exepath->path;
|
envpath->next = envpath->path;
|
||||||
|
|
||||||
/* And return the containing cast to an opaque handle */
|
/* And return the containing cast to an opaque handle */
|
||||||
|
|
||||||
return (EXEPATH_HANDLE)exepath;
|
return (ENVPATH_HANDLE)envpath;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: exepath_next
|
* Name: envpath_next
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Traverse all possible values in the PATH variable in attempt to find
|
* Traverse all possible values in the PATH variable in attempt to find
|
||||||
* the full path to an executable file when only a relative path is
|
* the full path to an envcutable file when only a relative path is
|
||||||
* provided.
|
* provided.
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* handle - The handle value returned by exepath_init
|
* handle - The handle value returned by envpath_init
|
||||||
* relpath - The relative path to the file to be found.
|
* relpath - The relative path to the file to be found.
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
* On success, a non-NULL pointer to a null-terminated string is provided.
|
* On success, a non-NULL pointer to a null-terminated string is provided.
|
||||||
* This is the full path to a file that exists in the file system. This
|
* This is the full path to a file that exists in the file system. This
|
||||||
* function will verify that the file exists (but will not verify that it
|
* function will verify that the file exists (but will not verify that it
|
||||||
* is marked executable).
|
* is marked envcutable).
|
||||||
*
|
*
|
||||||
* NOTE: The string pointer return in the success case points to allocated
|
* NOTE: The string pointer return in the success case points to allocated
|
||||||
* memory. This memory must be freed by the called by calling kmm_free().
|
* memory. This memory must be freed by the called by calling lib_free().
|
||||||
*
|
*
|
||||||
* NULL is returned if no path is found to any file with the provided
|
* NULL is returned if no path is found to any file with the provided
|
||||||
* 'relpath' from any absolute path in the PATH variable. In this case,
|
* 'relpath' from any absolute path in the PATH variable. In this case,
|
||||||
* there is no point in calling exepath_next() further; exepath_release()
|
* there is no point in calling envpath_next() further; envpath_release()
|
||||||
* must be called to release resources set aside by expath_init().
|
* must be called to release resources set aside by expath_init().
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
FAR char *exepath_next(EXEPATH_HANDLE handle, FAR const char *relpath)
|
FAR char *envpath_next(ENVPATH_HANDLE handle, FAR const char *relpath)
|
||||||
{
|
{
|
||||||
FAR struct exepath_s *exepath = (FAR struct exepath_s *)handle;
|
FAR struct envpath_s *envpath = (FAR struct envpath_s *)handle;
|
||||||
struct stat buf;
|
struct stat buf;
|
||||||
FAR char *endptr;
|
FAR char *endptr;
|
||||||
FAR char *path;
|
FAR char *path;
|
||||||
@ -170,7 +174,7 @@ FAR char *exepath_next(EXEPATH_HANDLE handle, FAR const char *relpath)
|
|||||||
|
|
||||||
/* Verify that a value handle and relative path were provided */
|
/* Verify that a value handle and relative path were provided */
|
||||||
|
|
||||||
DEBUGASSERT(exepath && relpath);
|
DEBUGASSERT(envpath && relpath);
|
||||||
DEBUGASSERT(relpath[0] != '\0' && relpath[0] != '/');
|
DEBUGASSERT(relpath[0] != '\0' && relpath[0] != '/');
|
||||||
|
|
||||||
/* Loop until (1) we find a file with this relative path from one of the
|
/* Loop until (1) we find a file with this relative path from one of the
|
||||||
@ -180,9 +184,9 @@ FAR char *exepath_next(EXEPATH_HANDLE handle, FAR const char *relpath)
|
|||||||
|
|
||||||
for (; ; )
|
for (; ; )
|
||||||
{
|
{
|
||||||
/* Make sure that exepath->next points to the beginning of a string */
|
/* Make sure that envpath->next points to the beginning of a string */
|
||||||
|
|
||||||
path = exepath->next;
|
path = envpath->next;
|
||||||
if (*path == '\0')
|
if (*path == '\0')
|
||||||
{
|
{
|
||||||
/* If it points to a NULL it means that either (1) the PATH varialbe
|
/* If it points to a NULL it means that either (1) the PATH varialbe
|
||||||
@ -199,7 +203,7 @@ FAR char *exepath_next(EXEPATH_HANDLE handle, FAR const char *relpath)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
endptr = strchr(path, ':');
|
endptr = strchr(path, ':');
|
||||||
if (!endptr)
|
if (endptr == NULL)
|
||||||
{
|
{
|
||||||
/* If strchr returns NUL it means that ':' does not appear in the
|
/* If strchr returns NUL it means that ':' does not appear in the
|
||||||
* string. Therefore, this must be the final path in the PATH
|
* string. Therefore, this must be the final path in the PATH
|
||||||
@ -207,19 +211,19 @@ FAR char *exepath_next(EXEPATH_HANDLE handle, FAR const char *relpath)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
endptr = &path[strlen(path)];
|
endptr = &path[strlen(path)];
|
||||||
exepath->next = endptr;
|
envpath->next = endptr;
|
||||||
DEBUGASSERT(*endptr == '\0');
|
DEBUGASSERT(*endptr == '\0');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DEBUGASSERT(*endptr == ':');
|
DEBUGASSERT(*endptr == ':');
|
||||||
exepath->next = endptr + 1;
|
envpath->next = endptr + 1;
|
||||||
*endptr = '\0';
|
*endptr = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
pathlen = strlen(path) + strlen(relpath) + 2;
|
pathlen = strlen(path) + strlen(relpath) + 2;
|
||||||
fullpath = (FAR char *)kmm_malloc(pathlen);
|
fullpath = (FAR char *)lib_malloc(pathlen);
|
||||||
if (!fullpath)
|
if (fullpathi == NULL)
|
||||||
{
|
{
|
||||||
/* Failed to allocate memory */
|
/* Failed to allocate memory */
|
||||||
|
|
||||||
@ -242,33 +246,33 @@ FAR char *exepath_next(EXEPATH_HANDLE handle, FAR const char *relpath)
|
|||||||
* continue to try the next path.
|
* continue to try the next path.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
kmm_free(fullpath);
|
lib_free(fullpath);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We will not get here */
|
/* We will not get here */
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: exepath_release
|
* Name: envpath_release
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Release all resources set aside by exepath_init() when the handle value
|
* Release all resources set aside by envpath_init() when the handle value
|
||||||
* was created. The handle value is invalid on return from this function.
|
* was created. The handle value is invalid on return from this function.
|
||||||
* Attempts to all exepath_next() or exepath_release() with such a 'stale'
|
* Attempts to all envpath_next() or envpath_release() with such a 'stale'
|
||||||
* handle will result in undefined (i.e., not good) behavior.
|
* handle will result in undefined (i.e., not good) behavior.
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* handle - The handle value returned by exepath_init
|
* handle - The handle value returned by envpath_init
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void exepath_release(EXEPATH_HANDLE handle)
|
void envpath_release(ENVPATH_HANDLE handle)
|
||||||
{
|
{
|
||||||
kmm_free(handle);
|
lib_free(handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* !CONFIG_BINFMT_DISABLE && CONFIG_BINFMT_EXEPATH */
|
#endif /* CONFIG_LIBC_ENVPATH */
|
||||||
|
|
@ -56,4 +56,24 @@ config MODLIB_DUMPBUFFER
|
|||||||
---help---
|
---help---
|
||||||
Dump various module buffers for debug purposes
|
Dump various module buffers for debug purposes
|
||||||
|
|
||||||
|
config MODLIB_HAVE_SYMTAB
|
||||||
|
bool "Have symbol table"
|
||||||
|
default n if BUILD_KERNEL
|
||||||
|
---help---
|
||||||
|
If you have a module library symbol table, then you may select this
|
||||||
|
option in order to use it. Symbol tables are required in most
|
||||||
|
cases in order to link executable programs to the base code.
|
||||||
|
|
||||||
|
if MODLIB_HAVE_SYMTAB
|
||||||
|
|
||||||
|
config MODLIB_SYMTAB_ARRAY
|
||||||
|
string "Symbol table name used by dlsym"
|
||||||
|
default "g_mod_symtab"
|
||||||
|
|
||||||
|
config MODLIB_NSYMBOLS_VAR
|
||||||
|
string "Name of variable holding the number of symbols"
|
||||||
|
default "g_mod_nsymbols"
|
||||||
|
|
||||||
|
endif # MODLIB_HAVE_SYMTAB
|
||||||
|
|
||||||
endmenu # Module library configuration
|
endmenu # Module library configuration
|
||||||
|
@ -337,6 +337,7 @@ int modlib_symvalue(FAR struct module_s *modp,
|
|||||||
FAR const struct symtab_s *symbol;
|
FAR const struct symtab_s *symbol;
|
||||||
struct mod_exportinfo_s exportinfo;
|
struct mod_exportinfo_s exportinfo;
|
||||||
uintptr_t secbase;
|
uintptr_t secbase;
|
||||||
|
int nsymbols;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
switch (sym->st_shndx)
|
switch (sym->st_shndx)
|
||||||
@ -399,12 +400,13 @@ int modlib_symvalue(FAR struct module_s *modp,
|
|||||||
|
|
||||||
if (symbol == NULL)
|
if (symbol == NULL)
|
||||||
{
|
{
|
||||||
|
modlib_getsymtab(&symbol, &nsymbols);
|
||||||
#ifdef CONFIG_SYMTAB_ORDEREDBYNAME
|
#ifdef CONFIG_SYMTAB_ORDEREDBYNAME
|
||||||
symbol = symtab_findorderedbyname(g_modlib_symtab, exportinfo.name,
|
symbol = symtab_findorderedbyname(symbol, exportinfo.name,
|
||||||
g_modlib_nsymbols);
|
nsymbols);
|
||||||
#else
|
#else
|
||||||
symbol = symtab_findbyname(g_modlib_symtab, exportinfo.name,
|
symbol = symtab_findbyname(symbol, exportinfo.name,
|
||||||
g_modlib_nsymbols);
|
nsymbols);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* libs/libc/modlib/modlib_symtab.c
|
* libs/libc/modlib/modlib_symtab.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2015, 2017-2018 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -45,12 +45,39 @@
|
|||||||
#include <nuttx/module.h>
|
#include <nuttx/module.h>
|
||||||
#include <nuttx/lib/modlib.h>
|
#include <nuttx/lib/modlib.h>
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Pre-processor Definitions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef CONFIG_MODLIB_HAVE_SYMTAB
|
||||||
|
/* Symbol table used by dlsym */
|
||||||
|
|
||||||
|
# ifndef CONFIG_MODLIB_SYMTAB_ARRAY
|
||||||
|
# error "CONFIG_MODLIB_SYMTAB_ARRAY must be defined"
|
||||||
|
# endif
|
||||||
|
|
||||||
|
/* Number of Symbols in the Table */
|
||||||
|
|
||||||
|
# ifndef CONFIG_MODLIB_NSYMBOLS_VAR
|
||||||
|
# error "CONFIG_MODLIB_NSYMBOLS_VAR must be defined"
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Data
|
* Public Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
FAR const struct symtab_s *g_modlib_symtab;
|
#ifdef CONFIG_MODLIB_HAVE_SYMTAB
|
||||||
FAR int g_modlib_nsymbols;
|
extern const struct symtab_s CONFIG_MODLIB_SYMTAB_ARRAY[];
|
||||||
|
extern int CONFIG_MODLIB_NSYMBOLS_VAR;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Private Data
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
static FAR const struct symtab_s *g_modlib_symtab;
|
||||||
|
static FAR int g_modlib_nsymbols;
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
@ -64,7 +91,8 @@ FAR int g_modlib_nsymbols;
|
|||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* symtab - The location to store the symbol table.
|
* symtab - The location to store the symbol table.
|
||||||
* nsymbols - The location to store the number of symbols in the symbol table.
|
* nsymbols - The location to store the number of symbols in the symbol
|
||||||
|
* table.
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
* None
|
* None
|
||||||
@ -78,6 +106,14 @@ void modlib_getsymtab(FAR const struct symtab_s **symtab, FAR int *nsymbols)
|
|||||||
/* Borrow the registry lock to assure atomic access */
|
/* Borrow the registry lock to assure atomic access */
|
||||||
|
|
||||||
modlib_registry_lock();
|
modlib_registry_lock();
|
||||||
|
#ifdef CONFIG_MODLIB_HAVE_SYMTAB
|
||||||
|
if (g_modlib_symtab == NULL)
|
||||||
|
{
|
||||||
|
g_modlib_symtab = CONFIG_MODLIB_SYMTAB_ARRAY;
|
||||||
|
g_modlib_nsymbols = CONFIG_MODLIB_NSYMBOLS_VAR;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
*symtab = g_modlib_symtab;
|
*symtab = g_modlib_symtab;
|
||||||
*nsymbols = g_modlib_nsymbols;
|
*nsymbols = g_modlib_nsymbols;
|
||||||
modlib_registry_unlock();
|
modlib_registry_unlock();
|
||||||
|
@ -111,7 +111,7 @@
|
|||||||
* task.
|
* task.
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* path - The path to the program to be executed. If CONFIG_BINFMT_EXEPATH
|
* path - The path to the program to be executed. If CONFIG_LIB_ENVPATH
|
||||||
* is defined in the configuration, then this may be a relative path
|
* is defined in the configuration, then this may be a relative path
|
||||||
* from the current working directory. Otherwise, path must be the
|
* from the current working directory. Otherwise, path must be the
|
||||||
* absolute path to the program.
|
* absolute path to the program.
|
||||||
|
@ -106,7 +106,7 @@
|
|||||||
* task.
|
* task.
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* path - The path to the program to be executed. If CONFIG_BINFMT_EXEPATH
|
* path - The path to the program to be executed. If CONFIG_LIB_ENVPATH
|
||||||
* is defined in the configuration, then this may be a relative path
|
* is defined in the configuration, then this may be a relative path
|
||||||
* from the current working directory. Otherwise, path must be the
|
* from the current working directory. Otherwise, path must be the
|
||||||
* absolute path to the program.
|
* absolute path to the program.
|
||||||
|
@ -69,7 +69,7 @@
|
|||||||
* child task in the variable pointed to by a non-NULL 'pid' argument.|
|
* child task in the variable pointed to by a non-NULL 'pid' argument.|
|
||||||
*
|
*
|
||||||
* path - The 'path' argument identifies the file to execute. If
|
* path - The 'path' argument identifies the file to execute. If
|
||||||
* CONFIG_BINFMT_EXEPATH is defined, this may be either a relative or
|
* CONFIG_LIB_ENVPATH is defined, this may be either a relative or
|
||||||
* or an absolute path. Otherwise, it must be an absolute path.
|
* or an absolute path. Otherwise, it must be an absolute path.
|
||||||
*
|
*
|
||||||
* attr - If the value of the 'attr' parameter is NULL, the all default
|
* attr - If the value of the 'attr' parameter is NULL, the all default
|
||||||
@ -257,7 +257,7 @@ static int posix_spawn_proxy(int argc, FAR char *argv[])
|
|||||||
* directories passed as the environment variable PATH.
|
* directories passed as the environment variable PATH.
|
||||||
*
|
*
|
||||||
* NOTE: NuttX provides only one implementation: If
|
* NOTE: NuttX provides only one implementation: If
|
||||||
* CONFIG_BINFMT_EXEPATH is defined, then only posix_spawnp() behavior
|
* CONFIG_LIB_ENVPATH is defined, then only posix_spawnp() behavior
|
||||||
* is supported; otherwise, only posix_spawn behavior is supported.
|
* is supported; otherwise, only posix_spawn behavior is supported.
|
||||||
*
|
*
|
||||||
* file_actions - If 'file_actions' is a null pointer, then file
|
* file_actions - If 'file_actions' is a null pointer, then file
|
||||||
@ -309,8 +309,8 @@ static int posix_spawn_proxy(int argc, FAR char *argv[])
|
|||||||
*
|
*
|
||||||
* Assumptions/Limitations:
|
* Assumptions/Limitations:
|
||||||
* - NuttX provides only posix_spawn() or posix_spawnp() behavior
|
* - NuttX provides only posix_spawn() or posix_spawnp() behavior
|
||||||
* depending upon the setting of CONFIG_BINFMT_EXEPATH: If
|
* depending upon the setting of CONFIG_LIB_ENVPATH: If
|
||||||
* CONFIG_BINFMT_EXEPATH is defined, then only posix_spawnp() behavior
|
* CONFIG_LIB_ENVPATH is defined, then only posix_spawnp() behavior
|
||||||
* is supported; otherwise, only posix_spawn behavior is supported.
|
* is supported; otherwise, only posix_spawn behavior is supported.
|
||||||
* - The 'envp' argument is not used and the 'environ' variable is not
|
* - The 'envp' argument is not used and the 'environ' variable is not
|
||||||
* altered (NuttX does not support the 'environ' variable).
|
* altered (NuttX does not support the 'environ' variable).
|
||||||
@ -327,7 +327,7 @@ static int posix_spawn_proxy(int argc, FAR char *argv[])
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_BINFMT_EXEPATH
|
#ifdef CONFIG_LIB_ENVPATH
|
||||||
int posix_spawnp(FAR pid_t *pid, FAR const char *path,
|
int posix_spawnp(FAR pid_t *pid, FAR const char *path,
|
||||||
FAR const posix_spawn_file_actions_t *file_actions,
|
FAR const posix_spawn_file_actions_t *file_actions,
|
||||||
FAR const posix_spawnattr_t *attr,
|
FAR const posix_spawnattr_t *attr,
|
||||||
|
@ -70,7 +70,7 @@
|
|||||||
* child task in the variable pointed to by a non-NULL 'pid' argument.|
|
* child task in the variable pointed to by a non-NULL 'pid' argument.|
|
||||||
*
|
*
|
||||||
* path - The 'path' argument identifies the file to execute. If
|
* path - The 'path' argument identifies the file to execute. If
|
||||||
* CONFIG_BINFMT_EXEPATH is defined, this may be either a relative or
|
* CONFIG_LIB_ENVPATH is defined, this may be either a relative or
|
||||||
* or an absolute path. Otherwise, it must be an absolute path.
|
* or an absolute path. Otherwise, it must be an absolute path.
|
||||||
*
|
*
|
||||||
* attr - If the value of the 'attr' parameter is NULL, the all default
|
* attr - If the value of the 'attr' parameter is NULL, the all default
|
||||||
|
@ -70,8 +70,8 @@
|
|||||||
"prctl","sys/prctl.h", "CONFIG_TASK_NAME_SIZE > 0","int","int","..."
|
"prctl","sys/prctl.h", "CONFIG_TASK_NAME_SIZE > 0","int","int","..."
|
||||||
"pread","unistd.h","CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0","ssize_t","int","FAR void*","size_t","off_t"
|
"pread","unistd.h","CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0","ssize_t","int","FAR void*","size_t","off_t"
|
||||||
"pwrite","unistd.h","CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0","ssize_t","int","FAR const void*","size_t","off_t"
|
"pwrite","unistd.h","CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0","ssize_t","int","FAR const void*","size_t","off_t"
|
||||||
"posix_spawnp","spawn.h","!defined(CONFIG_BINFMT_DISABLE) && defined(CONFIG_LIBC_EXECFUNCS) && defined(CONFIG_BINFMT_EXEPATH)","int","FAR pid_t *","FAR const char *","FAR const posix_spawn_file_actions_t *","FAR const posix_spawnattr_t *","FAR char *const []|FAR char *const *","FAR char *const []|FAR char *const *"
|
"posix_spawnp","spawn.h","!defined(CONFIG_BINFMT_DISABLE) && defined(CONFIG_LIBC_EXECFUNCS) && defined(CONFIG_LIB_ENVPATH)","int","FAR pid_t *","FAR const char *","FAR const posix_spawn_file_actions_t *","FAR const posix_spawnattr_t *","FAR char *const []|FAR char *const *","FAR char *const []|FAR char *const *"
|
||||||
"posix_spawn","spawn.h","!defined(CONFIG_BINFMT_DISABLE) && defined(CONFIG_LIBC_EXECFUNCS) && !defined(CONFIG_BINFMT_EXEPATH)","int","FAR pid_t *","FAR const char *","FAR const posix_spawn_file_actions_t *","FAR const posix_spawnattr_t *","FAR char *const []|FAR char *const *","FAR char *const []|FAR char *const *"
|
"posix_spawn","spawn.h","!defined(CONFIG_BINFMT_DISABLE) && defined(CONFIG_LIBC_EXECFUNCS) && !defined(CONFIG_LIB_ENVPATH)","int","FAR pid_t *","FAR const char *","FAR const posix_spawn_file_actions_t *","FAR const posix_spawnattr_t *","FAR char *const []|FAR char *const *","FAR char *const []|FAR char *const *"
|
||||||
"pthread_cancel","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","pthread_t"
|
"pthread_cancel","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","pthread_t"
|
||||||
"pthread_cleanup_pop","pthread.h","defined(CONFIG_PTHREAD_CLEANUP)","void","int"
|
"pthread_cleanup_pop","pthread.h","defined(CONFIG_PTHREAD_CLEANUP)","void","int"
|
||||||
"pthread_cleanup_push","pthread.h","defined(CONFIG_PTHREAD_CLEANUP)","void","pthread_cleanup_t","FAR void*"
|
"pthread_cleanup_push","pthread.h","defined(CONFIG_PTHREAD_CLEANUP)","void","pthread_cleanup_t","FAR void*"
|
||||||
|
Can't render this file because it has a wrong number of fields in line 2.
|
@ -135,7 +135,7 @@ SYSCALL_LOOKUP(up_assert, 2, STUB_up_assert)
|
|||||||
SYSCALL_LOOKUP(exec, 4, STUB_exec)
|
SYSCALL_LOOKUP(exec, 4, STUB_exec)
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_LIBC_EXECFUNCS
|
#ifdef CONFIG_LIBC_EXECFUNCS
|
||||||
#ifdef CONFIG_BINFMT_EXEPATH
|
#ifdef CONFIG_LIB_ENVPATH
|
||||||
SYSCALL_LOOKUP(posix_spawnp, 6, STUB_posix_spawnp)
|
SYSCALL_LOOKUP(posix_spawnp, 6, STUB_posix_spawnp)
|
||||||
#else
|
#else
|
||||||
SYSCALL_LOOKUP(posix_spawn, 6, STUB_posix_spawn)
|
SYSCALL_LOOKUP(posix_spawn, 6, STUB_posix_spawn)
|
||||||
|
@ -66,6 +66,8 @@ static const char *dequote_list[] =
|
|||||||
"CONFIG_USER_ENTRYPOINT", /* Name of entry point function */
|
"CONFIG_USER_ENTRYPOINT", /* Name of entry point function */
|
||||||
"CONFIG_EXECFUNCS_SYMTAB_ARRAY", /* Symbol table array used by exec[l|v] */
|
"CONFIG_EXECFUNCS_SYMTAB_ARRAY", /* Symbol table array used by exec[l|v] */
|
||||||
"CONFIG_EXECFUNCS_NSYMBOLS_VAR", /* Variable holding number of symbols in the table */
|
"CONFIG_EXECFUNCS_NSYMBOLS_VAR", /* Variable holding number of symbols in the table */
|
||||||
|
"CONFIG_MODLIB_SYMTAB_ARRAY", /* Symbol table array used by dllfcn[l|v] */
|
||||||
|
"CONFIG_MODLIB_NSYMBOLS_VAR", /* Variable holding number of symbols in the table */
|
||||||
"CONFIG_PASS1_BUILDIR", /* Pass1 build directory */
|
"CONFIG_PASS1_BUILDIR", /* Pass1 build directory */
|
||||||
"CONFIG_PASS1_TARGET", /* Pass1 build target */
|
"CONFIG_PASS1_TARGET", /* Pass1 build target */
|
||||||
"CONFIG_PASS1_OBJECT", /* Pass1 build object */
|
"CONFIG_PASS1_OBJECT", /* Pass1 build object */
|
||||||
|
Loading…
Reference in New Issue
Block a user