Added exec()

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1979 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2009-07-12 18:43:59 +00:00
parent 93e34db926
commit 29899e1069
5 changed files with 166 additions and 9 deletions
+28 -1
View File
@@ -85,7 +85,7 @@ struct binfmt_s
};
/****************************************************************************
* Public Functions
* Public Data
****************************************************************************/
#undef EXTERN
@@ -96,6 +96,10 @@ extern "C" {
#define EXTERN extern
#endif
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: register_binfmt
*
@@ -173,6 +177,29 @@ EXTERN int unload_module(FAR const struct binary_s *bin);
EXTERN int exec_module(FAR const struct binary_s *bin, int priority);
/****************************************************************************
* Name: exec
*
* Description:
* This is a convenience function that wraps load_ and exec_module into
* one call.
*
* Input Parameter:
* filename - Fulll path to the binary to be loaded
* argv - Argument list
* exports - Table of exported symbols
* nexports - The number of symbols in exports
*
* Returned Value:
* This is an end-user function, so it follows the normal convention:
* Returns the PID of the exec'ed module. On failure, it.returns
* -1 (ERROR) and sets errno appropriately.
*
****************************************************************************/
EXTERN int exec(FAR const char *filename, FAR const char **argv,
FAR const struct symtab_s *exports, int nexports);
#undef EXTERN
#if defined(__cplusplus)
}