You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2022/04/21 19:55:53 UTC

[incubator-nuttx] branch master updated (be95e76910 -> 2f32c8dcf2)

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

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


    from be95e76910 arch/risc-v: Enable FPU for K210
     new ce49c80976 sched/task: Correct the comment about environment variable
     new 9794068a9c sched/environ: Remove the unneeded cast in env_dup
     new 76803f4a07 sched/environ: Replace get_environ_ptr with environ
     new 2f32c8dcf2 environ: Don't expose get_environ_ptr in csdlib

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 binfmt/binfmt_execmodule.c   |  2 +-
 include/cxx/cstdlib          |  3 ---
 include/stdlib.h             | 10 +++++-----
 sched/environ/env_dup.c      |  2 +-
 sched/task/task_posixspawn.c | 10 ++--------
 sched/task/task_spawn.c      |  3 ++-
 sched/task/task_vfork.c      |  2 +-
 7 files changed, 12 insertions(+), 20 deletions(-)


[incubator-nuttx] 04/04: environ: Don't expose get_environ_ptr in csdlib

Posted by pk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 2f32c8dcf2211e0be4b323c53440c9349acc041e
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Thu Apr 21 15:25:49 2022 +0800

    environ: Don't expose get_environ_ptr in csdlib
    
    since it isn't defined in c/c++ standard
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 include/cxx/cstdlib |  3 ---
 include/stdlib.h    | 10 +++++-----
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/include/cxx/cstdlib b/include/cxx/cstdlib
index eace8b417a..8443f4f7b0 100644
--- a/include/cxx/cstdlib
+++ b/include/cxx/cstdlib
@@ -42,9 +42,6 @@ namespace std
 
   // Environment variable support
 
-#ifndef CONFIG_DISABLE_ENVIRON
-  using ::get_environ_ptr;
-#endif
   using ::getenv;
   using ::putenv;
   using ::clearenv;
diff --git a/include/stdlib.h b/include/stdlib.h
index d40d0e0fed..534dcb7db3 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -62,7 +62,11 @@
  * function call.  However, get_environ_ptr() can be used in its place.
  */
 
-#define environ get_environ_ptr()
+#ifdef CONFIG_DISABLE_ENVIRON
+#  define environ NULL
+#else
+#  define environ get_environ_ptr()
+#endif
 
 #if defined(CONFIG_FS_LARGEFILE) && defined(CONFIG_HAVE_LONG_LONG)
 #  define mkstemp64            mkstemp
@@ -138,11 +142,7 @@ void      arc4random_buf(FAR void *bytes, size_t nbytes);
 
 /* Environment variable support */
 
-#ifdef CONFIG_DISABLE_ENVIRON
-#  define get_environ_ptr() NULL
-#else
 FAR char **get_environ_ptr(void);
-#endif
 FAR char *getenv(FAR const char *name);
 int       putenv(FAR const char *string);
 int       clearenv(void);


[incubator-nuttx] 01/04: sched/task: Correct the comment about environment variable

Posted by pk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit ce49c80976effe16eb0977635ce45b775c983ff4
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Wed Apr 20 21:45:45 2022 +0800

    sched/task: Correct the comment about environment variable
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 sched/task/task_posixspawn.c | 10 ++--------
 sched/task/task_spawn.c      |  3 ++-
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/sched/task/task_posixspawn.c b/sched/task/task_posixspawn.c
index 6368a85511..cb7f78d51c 100644
--- a/sched/task/task_posixspawn.c
+++ b/sched/task/task_posixspawn.c
@@ -276,12 +276,8 @@ static int nxposix_spawn_proxy(int argc, FAR char *argv[])
  *     array of pointers to null-terminated strings. The list is terminated
  *     with a null pointer.
  *
- *   envp - The envp[] argument is not used by NuttX and may be NULL.  In
- *     standard implementations, envp[] is an array of character pointers to
- *     null-terminated strings that provide the environment for the new
- *     process image. The environment array is terminated by a null pointer.
- *     In NuttX, the envp[] argument is ignored and the new task will simply
- *     inherit the environment of the parent task.
+ *   envp - envp[] is an array of character pointers to null-terminated
+ *     strings that provide the environment for the new process image.
  *
  * Returned Value:
  *   posix_spawn() and posix_spawnp() will return zero on success.
@@ -297,8 +293,6 @@ static int nxposix_spawn_proxy(int argc, FAR char *argv[])
  *     depending upon the setting of CONFIG_LIBC_ENVPATH: If
  *     CONFIG_LIBC_ENVPATH is defined, then only posix_spawnp() behavior
  *     is supported; otherwise, only posix_spawn behavior is supported.
- *   - The 'envp' argument is not used and the 'environ' variable is not
- *     altered (NuttX does not support the 'environ' variable).
  *   - Process groups are not supported (POSIX_SPAWN_SETPGROUP).
  *   - Effective user IDs are not supported (POSIX_SPAWN_RESETIDS).
  *   - Signal default actions cannot be modified in the newly task executed
diff --git a/sched/task/task_spawn.c b/sched/task/task_spawn.c
index 6374a6e873..7f79c941ad 100644
--- a/sched/task/task_spawn.c
+++ b/sched/task/task_spawn.c
@@ -292,7 +292,8 @@ static int nxtask_spawn_proxy(int argc, FAR char *argv[])
  *     array of pointers to null-terminated strings. The list is terminated
  *     with a null pointer.
  *
- *   envp - The envp[] argument is not used by NuttX and may be NULL.
+ *   envp - envp[] is an array of character pointers to null-terminated
+ *     strings that provide the environment for the new process image.
  *
  * Returned Value:
  *   task_spawn() will return process ID of new task on success.


[incubator-nuttx] 03/04: sched/environ: Replace get_environ_ptr with environ

Posted by pk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 76803f4a0776674c0e6b11a4761024a758231925
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Thu Apr 21 19:22:10 2022 +0800

    sched/environ: Replace get_environ_ptr with environ
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 binfmt/binfmt_execmodule.c | 2 +-
 sched/task/task_vfork.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/binfmt/binfmt_execmodule.c b/binfmt/binfmt_execmodule.c
index e56903bc3f..59188577dc 100644
--- a/binfmt/binfmt_execmodule.c
+++ b/binfmt/binfmt_execmodule.c
@@ -153,7 +153,7 @@ int exec_module(FAR const struct binary_s *binp,
 
   /* Make a copy of the environment here */
 
-  if (envp || (envp = get_environ_ptr()))
+  if (envp || (envp = environ))
     {
       envp = binfmt_copyenv(envp);
       if (!envp)
diff --git a/sched/task/task_vfork.c b/sched/task/task_vfork.c
index 64e1f7d35c..f535614c62 100644
--- a/sched/task/task_vfork.c
+++ b/sched/task/task_vfork.c
@@ -154,7 +154,7 @@ FAR struct task_tcb_s *nxtask_setup_vfork(start_t retaddr)
 
   /* Duplicate the parent tasks environment */
 
-  ret = env_dup(child->cmn.group, get_environ_ptr());
+  ret = env_dup(child->cmn.group, environ);
   if (ret < 0)
     {
       goto errout_with_tcb;


[incubator-nuttx] 02/04: sched/environ: Remove the unneeded cast in env_dup

Posted by pk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 9794068a9c7ec17d7aac51f936d712ef6dd06fc4
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Thu Apr 21 15:27:49 2022 +0800

    sched/environ: Remove the unneeded cast in env_dup
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 sched/environ/env_dup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sched/environ/env_dup.c b/sched/environ/env_dup.c
index 87e9274c77..f1b351ef4c 100644
--- a/sched/environ/env_dup.c
+++ b/sched/environ/env_dup.c
@@ -78,7 +78,7 @@ int env_dup(FAR struct task_group_s *group, FAR char * const *envcp)
 
   /* Is there an environment ? */
 
-  if (envcp || (envcp = (FAR char * const *)ptcb->group->tg_envp))
+  if (envcp || (envcp = ptcb->group->tg_envp))
     {
       /* Count the strings */