summaryrefslogtreecommitdiff
path: root/components/libc/compilers/common
diff options
context:
space:
mode:
Diffstat (limited to 'components/libc/compilers/common')
-rw-r--r--components/libc/compilers/common/readme.md4
-rw-r--r--components/libc/compilers/common/stdlib.c10
-rw-r--r--components/libc/compilers/common/unistd.c37
3 files changed, 40 insertions, 11 deletions
diff --git a/components/libc/compilers/common/readme.md b/components/libc/compilers/common/readme.md
index 99797d933c..81bb005d0a 100644
--- a/components/libc/compilers/common/readme.md
+++ b/components/libc/compilers/common/readme.md
@@ -1,8 +1,8 @@
## Attentions
-1. This folder is "common" for armlibc newlibc and dlib. It's not "common" for minilibc.
+1. This folder is "common" for armlibc newlibc and dlib.
-2. If you want to add new .c files, please do not forget to fix SConscript file too. eg:
+2. If you want to add new `.c` files, please do not forget to fix SConscript file too. eg:
```python
if GetDepend('RT_USING_POSIX') == False:
diff --git a/components/libc/compilers/common/stdlib.c b/components/libc/compilers/common/stdlib.c
index 9f801ab966..48a86098cd 100644
--- a/components/libc/compilers/common/stdlib.c
+++ b/components/libc/compilers/common/stdlib.c
@@ -14,18 +14,10 @@ void __rt_libc_exit(int status)
{
rt_thread_t self = rt_thread_self();
-#ifdef RT_USING_MODULE
- if (dlmodule_self())
- {
- dlmodule_exit(status);
- }
-#endif
-
if (self != RT_NULL)
{
rt_kprintf("thread:%s exit:%d!\n", self->name, status);
- rt_thread_suspend(self);
- rt_schedule();
+ rt_thread_control(self, RT_THREAD_CTRL_CLOSE, RT_NULL);
}
}
diff --git a/components/libc/compilers/common/unistd.c b/components/libc/compilers/common/unistd.c
index 48e6beee4e..0966242e55 100644
--- a/components/libc/compilers/common/unistd.c
+++ b/components/libc/compilers/common/unistd.c
@@ -49,3 +49,40 @@ int usleep(useconds_t usec)
return 0;
}
RTM_EXPORT(usleep);
+
+pid_t getpid(void)
+{
+ /*TODO*/
+ return 0;
+}
+RTM_EXPORT(getpid);
+
+pid_t getppid(void)
+{
+ return 0;
+}
+RTM_EXPORT(getppid);
+
+uid_t getuid(void)
+{
+ return 0; /*ROOT*/
+}
+RTM_EXPORT(getuid);
+
+uid_t geteuid(void)
+{
+ return 0; /*ROOT*/
+}
+RTM_EXPORT(geteuid);
+
+gid_t getgid(void)
+{
+ return 0; /*ROOT*/
+}
+RTM_EXPORT(getgid);
+
+gid_t getegid(void)
+{
+ return 0; /*ROOT*/
+}
+RTM_EXPORT(getegid);