From c13c00e45cb7af93c3e2b697555778844d1ebaec Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Sun, 21 Feb 2021 18:01:29 +0800 Subject: [PATCH] update --- .../libc/compilers/armlibc/sys/unistd.h | 6 +++- components/libc/compilers/common/unistd.c | 32 ++++++++++++++++--- components/libc/compilers/dlib/sys/unistd.h | 6 +++- 3 files changed, 38 insertions(+), 6 deletions(-) diff --git a/components/libc/compilers/armlibc/sys/unistd.h b/components/libc/compilers/armlibc/sys/unistd.h index e1a1ad92f4..ee1e1c4db9 100644 --- a/components/libc/compilers/armlibc/sys/unistd.h +++ b/components/libc/compilers/armlibc/sys/unistd.h @@ -73,7 +73,11 @@ char * ttyname (int desc); unsigned int sleep(unsigned int seconds); int usleep(useconds_t usec); -uid_t getuid(void); pid_t getpid(void); +pid_t getppid(void); +uid_t getuid(void); +uid_t geteuid(void); +gid_t getgid(void); +gid_t getegid(void); #endif /* _SYS_UNISTD_H */ diff --git a/components/libc/compilers/common/unistd.c b/components/libc/compilers/common/unistd.c index c7ad654da7..b3efc386e9 100644 --- a/components/libc/compilers/common/unistd.c +++ b/components/libc/compilers/common/unistd.c @@ -50,14 +50,38 @@ int usleep(useconds_t usec) } RTM_EXPORT(usleep); +pid_t getpid(void) +{ + return 0; +} +RTM_EXPORT(getpid); + +pid_t getppid(void) +{ + return 0; +} +RTM_EXPORT(getppid); + uid_t getuid(void) { - return -1; + return 0; } RTM_EXPORT(getuid); -pid_t getpid(void) +uid_t geteuid(void) { - return -1; + return 0; } -RTM_EXPORT(getuid); +RTM_EXPORT(geteuid); + +gid_t getgid(void) +{ + return 0; +} +RTM_EXPORT(getgid); + +gid_t getegid(void) +{ + return 0; +} +RTM_EXPORT(getegid); diff --git a/components/libc/compilers/dlib/sys/unistd.h b/components/libc/compilers/dlib/sys/unistd.h index 5ca56ad136..5b86822635 100644 --- a/components/libc/compilers/dlib/sys/unistd.h +++ b/components/libc/compilers/dlib/sys/unistd.h @@ -47,7 +47,11 @@ char * ttyname (int desc); unsigned int sleep(unsigned int seconds); int usleep(useconds_t usec); -uid_t getuid(void); pid_t getpid(void); +pid_t getppid(void); +uid_t getuid(void); +uid_t geteuid(void); +gid_t getgid(void); +gid_t getegid(void); #endif /* _SYS_UNISTD_H */ -- GitLab