MCPcopy Create free account
hub / github.com/apache/nuttx / nxposix_spawn_exec

Function nxposix_spawn_exec

sched/task/task_posixspawn.c:90–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88 ****************************************************************************/
89
90static int nxposix_spawn_exec(FAR pid_t *pidp, FAR const char *path,
91 FAR const posix_spawn_file_actions_t *actions,
92 FAR const posix_spawnattr_t *attr,
93 FAR char * const argv[],
94 FAR char * const envp[])
95{
96 FAR const struct symtab_s *symtab;
97 int nsymbols;
98 int pid;
99 int ret = OK;
100
101 DEBUGASSERT(path);
102
103 /* Get the current symbol table selection */
104
105 exec_getsymtab(&symtab, &nsymbols);
106
107 /* Start the task */
108
109 pid = exec_spawn(path, argv, envp, symtab, nsymbols, actions, attr);
110 if (pid < 0)
111 {
112 ret = -pid;
113 serr("ERROR: exec failed: %d\n", ret);
114 return ret;
115 }
116
117 /* Return the task ID to the caller */
118
119 if (pid)
120 {
121 *pidp = pid;
122 }
123
124 return ret;
125}
126
127/****************************************************************************
128 * Public Functions

Callers 1

posix_spawnFunction · 0.85

Calls 2

exec_getsymtabFunction · 0.85
exec_spawnFunction · 0.85

Tested by

no test coverage detected