summaryrefslogtreecommitdiff
path: root/components/libc
diff options
context:
space:
mode:
authorMeco Man <[email protected]>2021-02-22 16:53:54 +0800
committerMeco Man <[email protected]>2021-02-22 16:53:54 +0800
commit69dc37e1aa8806d3ef17b8f6fa3d33284b26ef60 (patch)
tree70e0ccfeb83397cf0b2091cb26fad7afbe55330b /components/libc
parent46b5eb378f6ea55963f5795762f2b7e5c97626f1 (diff)
update
Diffstat (limited to 'components/libc')
-rw-r--r--components/libc/compilers/common/unistd.c8
-rw-r--r--components/libc/compilers/newlib/syscalls.c10
2 files changed, 14 insertions, 4 deletions
diff --git a/components/libc/compilers/common/unistd.c b/components/libc/compilers/common/unistd.c
index 0966242e55..7ecd455480 100644
--- a/components/libc/compilers/common/unistd.c
+++ b/components/libc/compilers/common/unistd.c
@@ -50,7 +50,13 @@ int usleep(useconds_t usec)
}
RTM_EXPORT(usleep);
-pid_t getpid(void)
+pid_t
+#if defined (RT_USING_NEWLIB)
+__rt_libc_getpid
+#else
+getpid
+#endif
+(void)
{
/*TODO*/
return 0;
diff --git a/components/libc/compilers/newlib/syscalls.c b/components/libc/compilers/newlib/syscalls.c
index 3eabad9b55..28e1808e3f 100644
--- a/components/libc/compilers/newlib/syscalls.c
+++ b/components/libc/compilers/newlib/syscalls.c
@@ -36,6 +36,13 @@ __errno ()
#endif
int
+_getpid_r(struct _reent *ptr)
+{
+ extern pid_t __rt_libc_getpid(void);
+ return __rt_libc_getpid();
+}
+
+int
_close_r(struct _reent *ptr, int fd)
{
#ifndef RT_USING_DFS
@@ -332,7 +339,4 @@ int flock(int fd, int operation)
These functions are implemented and replaced by the 'common/time.c' file
int _gettimeofday_r(struct _reent *ptr, struct timeval *__tp, void *__tzp);
_CLOCK_T_ _times_r(struct _reent *ptr, struct tms *ptms);
-
-These functions are implemented and replaced by the "common/unistd.c" file
-int _getpid_r(struct _reent *ptr);
*/