diff options
author | Thomas Schwinge <thomas@codesourcery.com> | 2023-11-06 16:48:20 +0100 |
---|---|---|
committer | Thomas Schwinge <thomas@codesourcery.com> | 2023-12-23 10:26:58 +0100 |
commit | 1a177610d8e181d09206a5a8ce2d873822751657 (patch) | |
tree | b8acfbb9fc34d5c495fecf8a61d214c4575a377a /newlib/libc | |
parent | 1df8f9f09b0999e04bc0bbd7170ac7dbfa278213 (diff) | |
download | newlib-1a177610d8e181d09206a5a8ce2d873822751657.zip newlib-1a177610d8e181d09206a5a8ce2d873822751657.tar.gz newlib-1a177610d8e181d09206a5a8ce2d873822751657.tar.bz2 |
GCN: Implement '_exit' instead of 'exit'
... so that all of 'exit', '_exit', '_Exit' work. 'exit' thus becomes the
standard 'newlib/libc/stdlib/exit.c'. (Getting 'atexit' functional needs
further work elsewhere.)
See also commit 5841b2f6a4208682264d03e3edfa0a09881932a6
"nvptx: Implement '_exit' instead of 'exit'".
Diffstat (limited to 'newlib/libc')
-rw-r--r-- | newlib/libc/machine/amdgcn/Makefile.inc | 2 | ||||
-rw-r--r-- | newlib/libc/machine/amdgcn/_exit.c (renamed from newlib/libc/machine/amdgcn/exit.c) | 4 | ||||
-rw-r--r-- | newlib/libc/machine/amdgcn/atexit.c | 3 |
3 files changed, 4 insertions, 5 deletions
diff --git a/newlib/libc/machine/amdgcn/Makefile.inc b/newlib/libc/machine/amdgcn/Makefile.inc index d26603a..e1fc5ae 100644 --- a/newlib/libc/machine/amdgcn/Makefile.inc +++ b/newlib/libc/machine/amdgcn/Makefile.inc @@ -1,6 +1,6 @@ libc_a_SOURCES += \ + %D%/_exit.c \ %D%/abort.c \ - %D%/exit.c \ %D%/atexit.c \ %D%/mlock.c \ %D%/getreent.c \ diff --git a/newlib/libc/machine/amdgcn/exit.c b/newlib/libc/machine/amdgcn/_exit.c index bdd532e..82171af 100644 --- a/newlib/libc/machine/amdgcn/exit.c +++ b/newlib/libc/machine/amdgcn/_exit.c @@ -13,11 +13,11 @@ * they apply. */ -#include <stdlib.h> +#include <unistd.h> #include "exit-value.h" void __attribute__((noreturn)) -exit (int val) +_exit (int val) { exit_with_status_and_signal (val, 0); } diff --git a/newlib/libc/machine/amdgcn/atexit.c b/newlib/libc/machine/amdgcn/atexit.c index 6745714..8ddd92c 100644 --- a/newlib/libc/machine/amdgcn/atexit.c +++ b/newlib/libc/machine/amdgcn/atexit.c @@ -18,8 +18,7 @@ int atexit (void (*function)(void)) { - /* Our current implementation of exit does not run functions registered with - atexit, so fail here. */ + /* Fail here. */ abort (); return 1; } |