task: Always implement posix_spawnp as macro

Since there is no benefit to implement it as
function when CONFIG_LIBC_ENVPATH equals y

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-02-09 03:31:02 +08:00 committed by Xiang Xiao
parent 0cfdfde6c7
commit 0000e61da6
4 changed files with 1 additions and 22 deletions

View File

@ -125,21 +125,12 @@ extern "C"
* file system at 'path'
*/
#ifdef CONFIG_LIBC_ENVPATH
int posix_spawnp(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_spawn(pid,path,file_actions,attr,argv,envp) \
posix_spawnp(pid,path,file_actions,attr,argv,envp)
#else
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
#ifndef CONFIG_BUILD_KERNEL
/* Non-standard task_spawn interface. This function uses the same

View File

@ -146,11 +146,7 @@ SYSCALL_LOOKUP(up_assert, 2)
SYSCALL_LOOKUP(exec, 4)
#endif
#ifdef CONFIG_LIBC_EXECFUNCS
#ifdef CONFIG_LIBC_ENVPATH
SYSCALL_LOOKUP(posix_spawnp, 6)
#else
SYSCALL_LOOKUP(posix_spawn, 6)
#endif
SYSCALL_LOOKUP(execv, 2)
#endif
#endif

View File

@ -310,17 +310,10 @@ static int nxposix_spawn_proxy(int argc, FAR char *argv[])
*
****************************************************************************/
#ifdef CONFIG_LIBC_ENVPATH
int posix_spawnp(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[])
#else
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[])
#endif
{
struct sched_param param;
pid_t proxy;

View File

@ -82,8 +82,7 @@
"opendir","dirent.h","","FAR DIR *","FAR const char *"
"pgalloc", "nuttx/arch.h", "defined(CONFIG_BUILD_KERNEL)", "uintptr_t", "uintptr_t", "unsigned int"
"poll","poll.h","","int","FAR struct pollfd *","nfds_t","int"
"posix_spawn","spawn.h","!defined(CONFIG_BINFMT_DISABLE) && defined(CONFIG_LIBC_EXECFUNCS) && !defined(CONFIG_LIBC_ENVPATH)","int","FAR pid_t *","FAR const char *","FAR const posix_spawn_file_actions_t *","FAR const posix_spawnattr_t *","FAR char * const []|FAR char * const *","FAR char * const []|FAR char * const *"
"posix_spawnp","spawn.h","!defined(CONFIG_BINFMT_DISABLE) && defined(CONFIG_LIBC_EXECFUNCS) && defined(CONFIG_LIBC_ENVPATH)","int","FAR pid_t *","FAR const char *","FAR const posix_spawn_file_actions_t *","FAR const posix_spawnattr_t *","FAR char * const []|FAR char * const *","FAR char * const []|FAR char * const *"
"posix_spawn","spawn.h","!defined(CONFIG_BINFMT_DISABLE) && defined(CONFIG_LIBC_EXECFUNCS)","int","FAR pid_t *","FAR const char *","FAR const posix_spawn_file_actions_t *","FAR const posix_spawnattr_t *","FAR char * const []|FAR char * const *","FAR char * const []|FAR char * const *"
"ppoll","poll.h","","int","FAR struct pollfd *","nfds_t","FAR const struct timespec *","FAR const sigset_t *"
"prctl","sys/prctl.h", "CONFIG_TASK_NAME_SIZE > 0","int","int","...","uintptr_t","uintptr_t"
"pread","unistd.h","","ssize_t","int","FAR void *","size_t","off_t"

Can't render this file because it has a wrong number of fields in line 2.