File tree Expand file tree Collapse file tree 4 files changed +6
-31
lines changed
components/libc/compilers Expand file tree Collapse file tree 4 files changed +6
-31
lines changed Original file line number Diff line number Diff line change @@ -256,6 +256,7 @@ void _ttywrch(int ch)
256256#endif
257257}
258258
259+ /* for exit() and abort() */
259260RT_WEAK void _sys_exit (int return_code )
260261{
261262 extern void __rt_libc_exit (int status );
Original file line number Diff line number Diff line change 99 */
1010
1111#include <rtthread.h>
12- #include <stdlib.h>
1312
1413void __rt_libc_exit (int status )
1514{
@@ -24,24 +23,12 @@ void __rt_libc_exit(int status)
2423
2524 if (self != RT_NULL )
2625 {
27- if (status == EXIT_FAILURE ) /* abort() */
28- {
29- rt_kprintf ("thread:%s abort!\n" , self -> name );
30- }
31- else /* exit() */
32- {
33- rt_kprintf ("thread:%s exit:%d!\n" , self -> name , status );
34- }
26+ rt_kprintf ("thread:%s exit:%d!\n" , self -> name , status );
3527 rt_thread_suspend (self );
3628 rt_schedule ();
3729 }
3830}
3931
40- void __rt_libc_abort (void )
41- {
42- __rt_libc_exit (EXIT_FAILURE );
43- }
44-
4532int __rt_libc_system (const char * string )
4633{
4734 /* TODO */
Original file line number Diff line number Diff line change 99 */
1010#include <rtthread.h>
1111
12- void exit (int status )
12+ /* for exit() and abort() */
13+ void __exit (int status )
1314{
1415 extern void __rt_libc_exit (int status );
1516 __rt_libc_exit (status );
1617 while (1 );
1718}
18-
19- void abort (void )
20- {
21- extern void __rt_libc_abort (void );
22- __rt_libc_abort ();
23- while (1 );
24- }
Original file line number Diff line number Diff line change @@ -283,8 +283,8 @@ _free_r (struct _reent *ptr, void *addr)
283283 rt_free (addr );
284284}
285285
286- void
287- exit (int status )
286+ __attribute__ (( noreturn )) void
287+ _exit (int status )
288288{
289289 extern void __rt_libc_exit (int status );
290290 __rt_libc_exit (status );
@@ -303,13 +303,6 @@ void __libc_init_array(void)
303303 /* we not use __libc init_aray to initialize C++ objects */
304304}
305305
306- void abort (void )
307- {
308- extern void __rt_libc_abort (void );
309- __rt_libc_abort ();
310- while (1 );
311- }
312-
313306uid_t getuid (void )
314307{
315308 return 0 ;
You can’t perform that action at this time.
0 commit comments