summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMeco Man <[email protected]>2021-02-21 17:25:36 +0800
committerMeco Man <[email protected]>2021-02-21 17:25:36 +0800
commitd06420e1d7eda43fb7e76a726be7ee4a06018ed0 (patch)
tree5db408a0e7f8803b204212b0959fd708232b3f42
parentc21f018b4a6ea88e1cbec86514056629a25ccb67 (diff)
implement getuid and getpid
-rw-r--r--components/libc/compilers/armlibc/sys/unistd.h3
-rw-r--r--components/libc/compilers/common/unistd.c12
-rw-r--r--components/libc/compilers/dlib/sys/unistd.h3
3 files changed, 18 insertions, 0 deletions
diff --git a/components/libc/compilers/armlibc/sys/unistd.h b/components/libc/compilers/armlibc/sys/unistd.h
index 73a73a267e..e1a1ad92f4 100644
--- a/components/libc/compilers/armlibc/sys/unistd.h
+++ b/components/libc/compilers/armlibc/sys/unistd.h
@@ -73,4 +73,7 @@ char * ttyname (int desc);
unsigned int sleep(unsigned int seconds);
int usleep(useconds_t usec);
+uid_t getuid(void);
+pid_t getpid(void);
+
#endif /* _SYS_UNISTD_H */
diff --git a/components/libc/compilers/common/unistd.c b/components/libc/compilers/common/unistd.c
index 48e6beee4e..c7ad654da7 100644
--- a/components/libc/compilers/common/unistd.c
+++ b/components/libc/compilers/common/unistd.c
@@ -49,3 +49,15 @@ int usleep(useconds_t usec)
return 0;
}
RTM_EXPORT(usleep);
+
+uid_t getuid(void)
+{
+ return -1;
+}
+RTM_EXPORT(getuid);
+
+pid_t getpid(void)
+{
+ return -1;
+}
+RTM_EXPORT(getuid);
diff --git a/components/libc/compilers/dlib/sys/unistd.h b/components/libc/compilers/dlib/sys/unistd.h
index 6d99cd6c55..5ca56ad136 100644
--- a/components/libc/compilers/dlib/sys/unistd.h
+++ b/components/libc/compilers/dlib/sys/unistd.h
@@ -47,4 +47,7 @@ char * ttyname (int desc);
unsigned int sleep(unsigned int seconds);
int usleep(useconds_t usec);
+uid_t getuid(void);
+pid_t getpid(void);
+
#endif /* _SYS_UNISTD_H */