You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/02/09 12:09:18 UTC

[incubator-nuttx] branch master updated: task: Always implement posix_spawnp as macro

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 0000e61  task: Always implement posix_spawnp as macro
0000e61 is described below

commit 0000e61da64d5bcc8f2d69937927039a9d65d34e
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Wed Feb 9 03:31:02 2022 +0800

    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 <xi...@xiaomi.com>
---
 include/spawn.h              | 9 ---------
 include/sys/syscall_lookup.h | 4 ----
 sched/task/task_posixspawn.c | 7 -------
 syscall/syscall.csv          | 3 +--
 4 files changed, 1 insertion(+), 22 deletions(-)

diff --git a/include/spawn.h b/include/spawn.h
index dc3beb8..83e3220 100644
--- a/include/spawn.h
+++ b/include/spawn.h
@@ -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
diff --git a/include/sys/syscall_lookup.h b/include/sys/syscall_lookup.h
index 9275261..7da3fe8 100644
--- a/include/sys/syscall_lookup.h
+++ b/include/sys/syscall_lookup.h
@@ -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
diff --git a/sched/task/task_posixspawn.c b/sched/task/task_posixspawn.c
index c7ede6c..888e7b5 100644
--- a/sched/task/task_posixspawn.c
+++ b/sched/task/task_posixspawn.c
@@ -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;
diff --git a/syscall/syscall.csv b/syscall/syscall.csv
index 0962bd5..46e467d 100644
--- a/syscall/syscall.csv
+++ b/syscall/syscall.csv
@@ -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"