This commit is contained in:
Meco Man 2021-02-17 23:50:12 +08:00
parent 933c54c668
commit 263d856fa4
4 changed files with 20 additions and 21 deletions

View File

@ -258,8 +258,8 @@ void _ttywrch(int ch)
RT_WEAK void _sys_exit(int return_code)
{
extern void __exit__(int status);
__exit__(return_code);
extern void __rt_libc_exit(int status);
__rt_libc_exit(return_code);
while(1);
}
@ -306,8 +306,8 @@ int remove(const char *filename)
#else
int system(const char *string)
{
extern int __system__(const char *string);
return __system__(string);
extern int __rt_libc_system(const char *string);
return __rt_libc_system(string);
}
#endif

View File

@ -9,10 +9,9 @@
*/
#include <rtthread.h>
#include <stdlib.h>
#define ABORT_STATUS 1
void __exit__(int status)
void __rt_libc_exit(int status)
{
rt_thread_t self = rt_thread_self();
@ -25,7 +24,7 @@ void __exit__(int status)
if (self != RT_NULL)
{
if(status == ABORT_STATUS) /* abort() */
if(status == EXIT_FAILURE) /* abort() */
{
rt_kprintf("thread:%s abort!\n", self->name);
}
@ -38,12 +37,12 @@ void __exit__(int status)
}
}
void __abort__(void)
void __rt_libc_abort(void)
{
__exit__(ABORT_STATUS);
__rt_libc_exit(EXIT_FAILURE);
}
int __system__(const char *string)
int __rt_libc_system(const char *string)
{
/* TODO */
return 0;

View File

@ -11,14 +11,14 @@
void exit (int status)
{
extern void __exit__(int status);
__exit__(status);
extern void __rt_libc_exit(int status);
__rt_libc_exit(status);
while(1);
}
void abort(void)
{
extern void __abort__(void);
__abort__();
extern void __rt_libc_abort(void);
__rt_libc_abort();
while(1);
}

View File

@ -286,16 +286,16 @@ _free_r (struct _reent *ptr, void *addr)
void
exit (int status)
{
extern void __exit__(int status);
__exit__(status);
extern void __rt_libc_exit(int status);
__rt_libc_exit(status);
while(1);
}
void
_system(const char *s)
{
extern int __system__(const char *string);
__system__(s);
extern int __rt_libc_system(const char *string);
__rt_libc_system(s);
}
void __libc_init_array(void)
@ -305,8 +305,8 @@ void __libc_init_array(void)
void abort(void)
{
extern void __abort__(void);
__abort__();
extern void __rt_libc_abort(void);
__rt_libc_abort();
while(1);
}