Add interfaces to dynamically change symbol tables used by posix_spawn, execv, and execl. This is needed for testing.

git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5506 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2013-01-10 20:00:08 +00:00
parent 9f8f8fc6dc
commit 6f241ed044
9 changed files with 292 additions and 41 deletions
+7 -24
View File
@@ -51,27 +51,6 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* If CONFIG_LIBC_EXECFUNCS is defined in the configuration, then the
* following must also be defined:
*/
/* Symbol table used by exec[l|v] */
#ifndef CONFIG_EXECFUNCS_SYMTAB
# error "CONFIG_EXECFUNCS_SYMTAB must be defined"
#endif
/* Number of Symbols in the Table */
#ifndef CONFIG_EXECFUNCS_NSYMBOLS
# error "CONFIG_EXECFUNCS_NSYMBOLS must be defined"
#endif
/****************************************************************************
* Public Variables
****************************************************************************/
extern struct symtab_s CONFIG_EXECFUNCS_SYMTAB;
/****************************************************************************
* Private Variables
@@ -140,13 +119,17 @@ extern struct symtab_s CONFIG_EXECFUNCS_SYMTAB;
int execv(FAR const char *path, FAR char *const argv[])
{
FAR struct symtab_s *symtab;
int nsymbols;
int ret;
/* Get the current symbol table selection */
exec_getsymtab(&symtab, &nsymbols);
/* Start the task */
ret = exec(path, (FAR const char **)argv,
&CONFIG_EXECFUNCS_SYMTAB, CONFIG_EXECFUNCS_NSYMBOLS);
ret = exec(path, (FAR const char **)argv, symtab, nsymbols);
if (ret < 0)
{
sdbg("exec failed: %d\n", errno);