diff --git a/include/spawn.h b/include/spawn.h index 83e32202a29..dbecd88f12e 100644 --- a/include/spawn.h +++ b/include/spawn.h @@ -54,6 +54,13 @@ #define POSIX_SPAWN_SETSIGMASK (1 << 5) /* 1: Set sigmask */ #define POSIX_SPAWN_SETSID (1 << 7) /* 1: Create the new session(glibc specific) */ +/* NOTE: NuttX provides only one implementation: If + * CONFIG_LIBC_ENVPATH is defined, then only posix_spawnp() behavior + * is supported; otherwise, only posix_spawn behavior is supported. + */ + +#define posix_spawnp posix_spawn + /**************************************************************************** * Type Definitions ****************************************************************************/ @@ -129,8 +136,6 @@ 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) #ifndef CONFIG_BUILD_KERNEL /* Non-standard task_spawn interface. This function uses the same diff --git a/include/unistd.h b/include/unistd.h index de35eb42dd5..e754e0a804d 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -280,6 +280,17 @@ # define lockf64 lockf #endif +/* NOTE: NuttX provides only one implementation: If + * CONFIG_LIBC_ENVPATH is defined, then only execvp/execlp/execvpe behavior + * is supported; otherwise, only execv/execl/execve behavior is supported. + */ + +#ifdef CONFIG_LIBC_EXECFUNCS +# define execvp execv +# define execlp execl +# define execvpe execve +#endif + /**************************************************************************** * Public Data ****************************************************************************/