syscall: Add call gate for get_environ_ptr

Now that the environment strings are stored as an array of strings,
they can be passed from the application via char **environ, which
is really defined as a function call to get_environ_ptr().

This works as is for flat build, but protected mode and kernel mode
require a call gate, which is added here.
This commit is contained in:
Ville Juven
2022-04-20 13:41:26 +03:00
committed by Xiang Xiao
parent 4c1b66246d
commit d6ef4849a9
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -353,6 +353,7 @@ SYSCALL_LOOKUP(futimens, 2)
/* The following are defined only if environment variables are supported */
#ifndef CONFIG_DISABLE_ENVIRON
SYSCALL_LOOKUP(get_environ_ptr, 0)
SYSCALL_LOOKUP(clearenv, 0)
SYSCALL_LOOKUP(getenv, 1)
SYSCALL_LOOKUP(putenv, 1)
+1
View File
@@ -35,6 +35,7 @@
"fsync","unistd.h","!defined(CONFIG_DISABLE_MOUNTPOINT)","int","int"
"ftruncate","unistd.h","!defined(CONFIG_DISABLE_MOUNTPOINT)","int","int","off_t"
"futimens","sys/stat.h","","int","int","const struct timespec [2]|FAR const struct timespec *"
"get_environ_ptr","stdlib.h","!defined(CONFIG_DISABLE_ENVIRON)","FAR char **"
"getenv","stdlib.h","!defined(CONFIG_DISABLE_ENVIRON)","FAR char *","FAR const char *"
"getgid","unistd.h","defined(CONFIG_SCHED_USER_IDENTITY)","gid_t"
"gethostname","unistd.h","","int","FAR char *","size_t"
1 _exit unistd.h noreturn int
35 fsync unistd.h !defined(CONFIG_DISABLE_MOUNTPOINT) int int
36 ftruncate unistd.h !defined(CONFIG_DISABLE_MOUNTPOINT) int int
37 futimens sys/stat.h int int
38 get_environ_ptr stdlib.h !defined(CONFIG_DISABLE_ENVIRON) FAR char **
39 getenv stdlib.h !defined(CONFIG_DISABLE_ENVIRON) FAR char * FAR const char *
40 getgid unistd.h defined(CONFIG_SCHED_USER_IDENTITY) gid_t
41 gethostname unistd.h int FAR char *