summaryrefslogtreecommitdiff
path: root/nuttx/include/spawn.h
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-02-02 19:31:30 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-02-02 19:31:30 +0000
commit60185fe969614b01d5dc57f3aa157b24d2901af6 (patch)
treed63a6a6a97cae8d4fe62b41e900fbcd5c29aceaf /nuttx/include/spawn.h
parentf1851b468b62b448a0d9ed343d4ca8b9987e0d53 (diff)
downloadpx4-nuttx-60185fe969614b01d5dc57f3aa157b24d2901af6.tar.gz
px4-nuttx-60185fe969614b01d5dc57f3aa157b24d2901af6.tar.bz2
px4-nuttx-60185fe969614b01d5dc57f3aa157b24d2901af6.zip
New interface task_spawn(); exec_builtin() now uses task_spawn(); All argv types should be char * const * not const char **
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5598 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include/spawn.h')
-rw-r--r--nuttx/include/spawn.h40
1 files changed, 35 insertions, 5 deletions
diff --git a/nuttx/include/spawn.h b/nuttx/include/spawn.h
index 5e0ce3416..e6096fdba 100644
--- a/nuttx/include/spawn.h
+++ b/nuttx/include/spawn.h
@@ -75,12 +75,18 @@
struct posix_spawnattr_s
{
- uint8_t flags;
- uint8_t priority;
- uint8_t policy;
+ /* Used by posix_spawn, posix_spawnp, and task_spawn */
+
+ uint8_t flags; /* See POSIX_SPAWN_ definitions */
+ uint8_t priority; /* Task scheduling priority */
+ uint8_t policy; /* Task scheduling policy */
#ifndef CONFIG_DISABLE_SIGNALS
- sigset_t sigmask;
+ sigset_t sigmask; /* Signals to be masked */
#endif
+
+ /* Used only by task_spawn (non-standard) */
+
+ size_t stacksize; /* Task stack size */
};
typedef struct posix_spawnattr_s posix_spawnattr_t;
@@ -107,7 +113,10 @@ extern "C"
{
#endif
-/* posix_spawn[p] interfaces ************************************************/
+/* Spawn interfaces *********************************************************/
+/* Standard posix_spawn[p] interfaces. These functions execute files in the
+ * file system at 'path'
+ */
#ifdef CONFIG_BINFMT_EXEPATH
int posix_spawnp(FAR pid_t *pid, FAR const char *path,
@@ -121,8 +130,20 @@ int posix_spawn(FAR pid_t *pid, FAR const char *path,
FAR const posix_spawn_file_actions_t *file_actions,
FAR const posix_spawnattr_t *attr,
FAR char *const argv[], FAR char *const envp[]);
+#define posix_spawnp(pid,path,file_actions,attr,argv,envp) \
+ posix_spawn(pid,path,file_actions,attr,argv,envp)
#endif
+/* Non-standard task_spawn interface. This function uses the same
+ * semantics to execute a file in memory at 'entry', giving it the name
+ * 'name'.
+ */
+
+int task_spawn(FAR pid_t *pid, FAR const char *name, main_t entry,
+ FAR const posix_spawn_file_actions_t *file_actions,
+ FAR const posix_spawnattr_t *attr,
+ FAR char *const argv[], FAR char *const envp[]);
+
/* File action interfaces ***************************************************/
/* File action initialization and destruction */
@@ -181,6 +202,15 @@ int posix_spawnattr_setsigmask(FAR posix_spawnattr_t *attr,
# define posix_spawnattr_setsigmask(attr,sigmask) (ENOSYS)
#endif
+/* Non-standard get/set spawn attributes interfaces for use only with
+ * task_spawn()
+ */
+
+int task_spawnattr_getstacksize(FAR const posix_spawnattr_t *attr,
+ size_t *stacksize);
+int task_spawnattr_setstacksize(FAR posix_spawnattr_t *attr,
+ size_t stacksize);
+
/* Non standard debug functions */
#ifdef CONFIG_DEBUG