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 */