Skip to content

Commit 69dc37e

Browse files
committed
update
1 parent 46b5eb3 commit 69dc37e

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

components/libc/compilers/common/unistd.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,13 @@ int usleep(useconds_t usec)
5050
}
5151
RTM_EXPORT(usleep);
5252

53-
pid_t getpid(void)
53+
pid_t
54+
#if defined (RT_USING_NEWLIB)
55+
__rt_libc_getpid
56+
#else
57+
getpid
58+
#endif
59+
(void)
5460
{
5561
/*TODO*/
5662
return 0;

components/libc/compilers/newlib/syscalls.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ __errno ()
3535
}
3636
#endif
3737

38+
int
39+
_getpid_r(struct _reent *ptr)
40+
{
41+
extern pid_t __rt_libc_getpid(void);
42+
return __rt_libc_getpid();
43+
}
44+
3845
int
3946
_close_r(struct _reent *ptr, int fd)
4047
{
@@ -332,7 +339,4 @@ int flock(int fd, int operation)
332339
These functions are implemented and replaced by the 'common/time.c' file
333340
int _gettimeofday_r(struct _reent *ptr, struct timeval *__tp, void *__tzp);
334341
_CLOCK_T_ _times_r(struct _reent *ptr, struct tms *ptms);
335-
336-
These functions are implemented and replaced by the "common/unistd.c" file
337-
int _getpid_r(struct _reent *ptr);
338342
*/

0 commit comments

Comments
 (0)