Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: fusl/src/exit/exit.c

Issue 1573973002: Add a "fork" of musl as //fusl. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fusl/src/exit/atexit.c ('k') | fusl/src/exit/quick_exit.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #include <stdlib.h>
2 #include <stdint.h>
3 #include "libc.h"
4
5 static void dummy()
6 {
7 }
8
9 /* atexit.c and __stdio_exit.c override these. the latter is linked
10 * as a consequence of linking either __toread.c or __towrite.c. */
11 weak_alias(dummy, __funcs_on_exit);
12 weak_alias(dummy, __stdio_exit);
13 weak_alias(dummy, _fini);
14
15 __attribute__((__weak__, __visibility__("hidden")))
16 extern void (*const __fini_array_start)(void), (*const __fini_array_end)(void);
17
18 static void libc_exit_fini(void)
19 {
20 uintptr_t a = (uintptr_t)&__fini_array_end;
21 for (; a>(uintptr_t)&__fini_array_start; a-=sizeof(void(*)()))
22 (*(void (**)())(a-sizeof(void(*)())))();
23 _fini();
24 }
25
26 weak_alias(libc_exit_fini, __libc_exit_fini);
27
28 _Noreturn void exit(int code)
29 {
30 __funcs_on_exit();
31 __libc_exit_fini();
32 __stdio_exit();
33 _Exit(code);
34 }
OLDNEW
« no previous file with comments | « fusl/src/exit/atexit.c ('k') | fusl/src/exit/quick_exit.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698