Added flush of output on exit. On some UNIX's using the native library

resulted in no output when the output was redirected until this was done.
Redirection is important because runtest redirects test output.

Added support for numerous environment variables which make it easier
to run a multi-node system using a single executable and to tailor
the size of the workspace and heap.
This commit is contained in:
Joel Sherrill
1995-08-11 14:30:27 +00:00
parent aa9f19454a
commit c1403ef153
4 changed files with 65 additions and 48 deletions

View File

@@ -1,12 +1,12 @@
// @(#)rtems-ctor.cc 1.6 - 95/04/25
//
//
//
/*
* rtems-ctor.cc
*
* Description:
* This file exists solely to (try to) ensure RTEMS is initialized
* This file exists solely to (try to) ensure RTEMS is initialized
* before any global constructors are run.
*
* The problem:
@@ -49,6 +49,8 @@
*/
#include <bsp.h>
#include <stdio.h>
#include <stdlib.h>
/*
* RTEMS program name
@@ -61,7 +63,7 @@ char *rtems_progname;
class RTEMS {
public:
RTEMS();
RTEMS();
~RTEMS();
};
@@ -83,9 +85,9 @@ extern "C" {
char **argv,
char **environp)
{
rtems_argc = argc;
rtems_argv = argv;
rtems_envp = environp;
rtems_argc = argc;
rtems_argv = argv;
rtems_envp = environp;
if ((argc > 0) && argv && argv[0])
rtems_progname = argv[0];
@@ -103,6 +105,8 @@ extern "C" {
* This allows our destructors to get run normally
*/
fflush( stdout );
fflush( stderr );
return 0;
}
}