diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2018-01-03 17:39:24 -0700 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2018-01-03 17:39:24 -0700 |
commit | a6c1ed4716cf02626ea035beb6dd4a921642ba80 (patch) | |
tree | ef582c1b52819e27bdd16097ec03b69799d04ede /newlib/libc/stdlib/exit.c | |
parent | f6c9a624fa8a6878a7fb2b02f55e4990a20feb59 (diff) |
Use libc from agbcc instead of standalone newlib\nYou must have AGBCC commit 80d029caec189587f8b9294b6c8a5a489b8f5f88 in order to compile pmd_red.gbalibc
Diffstat (limited to 'newlib/libc/stdlib/exit.c')
-rw-r--r-- | newlib/libc/stdlib/exit.c | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/newlib/libc/stdlib/exit.c b/newlib/libc/stdlib/exit.c deleted file mode 100644 index 543bd0e..0000000 --- a/newlib/libc/stdlib/exit.c +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 1990 Regents of the University of California. - * All rights reserved. - * - * %sccs.include.redist.c% - */ - -/* -FUNCTION -<<exit>>---end program execution - -INDEX - exit - -ANSI_SYNOPSIS - #include <stdlib.h> - void exit(int <[code]>); - -TRAD_SYNOPSIS - #include <stdlib.h> - void exit(<[code]>) - int <[code]>; - -DESCRIPTION -Use <<exit>> to return control from a program to the host operating -environment. Use the argument <[code]> to pass an exit status to the -operating environment: two particular values, <<EXIT_SUCCESS>> and -<<EXIT_FAILURE>>, are defined in `<<stdlib.h>>' to indicate success or -failure in a portable fashion. - -<<exit>> does two kinds of cleanup before ending execution of your -program. First, it calls all application-defined cleanup functions -you have enrolled with <<atexit>>. Second, files and streams are -cleaned up: any pending output is delivered to the host system, each -open file or stream is closed, and files created by <<tmpfile>> are -deleted. - -RETURNS -<<exit>> does not return to its caller. - -PORTABILITY -ANSI C requires <<exit>>, and specifies that <<EXIT_SUCCESS>> and -<<EXIT_FAILURE>> must be defined. - -Supporting OS subroutines required: <<_exit>>. -*/ - -#include <stdlib.h> -#include <unistd.h> /* for _exit() declaration */ -#include <reent.h> - -#ifndef _REENT_ONLY - -/* - * Exit, flushing stdio buffers if necessary. - */ - -void -_DEFUN (exit, (code), - int code) -{ - register struct _atexit *p; - register int n; - - for (p = _REENT->_atexit; p; p = p->_next) - for (n = p->_ind; --n >= 0;) - (*p->_fns[n]) (); - if (_REENT->__cleanup) - (*_REENT->__cleanup) (_REENT); - _exit (code); -} - -#endif |