summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1996-04-22 16:50:17 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1996-04-22 16:50:17 +0000
commit1f94ed6bfdb8b83fcfcb59db0a9f76eb950b4db0 (patch)
tree441f57ebc555db3a382bac7e8dedd51ba55ab3e4 /cpukit
parentUpdates from Tony Bennett. rtems_environp removed among other minor things. (diff)
downloadrtems-1f94ed6bfdb8b83fcfcb59db0a9f76eb950b4db0.tar.bz2
Updates from Tony Bennett.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/libcsupport/include/rtems/libio.h3
-rw-r--r--cpukit/libcsupport/src/libio.c3
-rw-r--r--cpukit/libcsupport/src/malloc.c10
-rw-r--r--cpukit/libcsupport/src/newlibc.c43
4 files changed, 34 insertions, 25 deletions
diff --git a/cpukit/libcsupport/include/rtems/libio.h b/cpukit/libcsupport/include/rtems/libio.h
index f80a1954a3..07d72620b1 100644
--- a/cpukit/libcsupport/include/rtems/libio.h
+++ b/cpukit/libcsupport/include/rtems/libio.h
@@ -1,7 +1,4 @@
/*
- * @(#)libio.h 1.1 - 95/06/02
- *
- *
* General purpose communication channel for RTEMS to allow UNIX/POSIX
* system call behavior on top of RTEMS IO devices.
*
diff --git a/cpukit/libcsupport/src/libio.c b/cpukit/libcsupport/src/libio.c
index 73b6adf298..a01dea7b8a 100644
--- a/cpukit/libcsupport/src/libio.c
+++ b/cpukit/libcsupport/src/libio.c
@@ -1,7 +1,4 @@
/*
- * @(#)libio.c 1.1 - 95/06/02
- *
- *
* Provide UNIX/POSIX-like io system calls for RTEMS using the
* RTEMS IO manager
*
diff --git a/cpukit/libcsupport/src/malloc.c b/cpukit/libcsupport/src/malloc.c
index ed053d6e8d..de63df6ea0 100644
--- a/cpukit/libcsupport/src/malloc.c
+++ b/cpukit/libcsupport/src/malloc.c
@@ -25,12 +25,14 @@
#include <assert.h>
#include <errno.h>
#include <string.h>
+#include <unistd.h> /* sbrk(2) */
rtems_id RTEMS_Malloc_Heap;
size_t RTEMS_Malloc_Sbrk_amount;
#ifdef RTEMS_DEBUG
#define MALLOC_STATS
+#define MALLOC_DIRTY
#endif
#ifdef MALLOC_STATS
@@ -202,7 +204,11 @@ void *malloc(
malloc_stats.max_depth = current_depth;
}
#endif
-
+
+#ifdef MALLOC_DIRTY
+ (void) memset(return_this, 0xCF, size);
+#endif
+
return return_this;
}
@@ -221,6 +227,8 @@ void *calloc(
if ( cptr )
memset( cptr, '\0', length );
+ MSBUMP(malloc_calls, -1); /* subtract off the malloc */
+
return cptr;
}
diff --git a/cpukit/libcsupport/src/newlibc.c b/cpukit/libcsupport/src/newlibc.c
index ddcb961015..8c9ed2e1a8 100644
--- a/cpukit/libcsupport/src/newlibc.c
+++ b/cpukit/libcsupport/src/newlibc.c
@@ -1,17 +1,6 @@
-/*
- * @(#)newlibc.c 1.9 - 95/05/16
- *
- */
-
#if defined(RTEMS_NEWLIB)
/*
- * File: newlibc.c,v
- * Project: PixelFlow
- * Created: 94/12/7
- * Revision: 1.2
- * Last Mod: 1995/05/09 20:24:37
- *
* COPYRIGHT (c) 1994 by Division Incorporated
*
* To anyone who acknowledges that this file is provided "AS IS"
@@ -47,8 +36,25 @@
#include <sys/reent.h> /* for extern of _REENT (aka _impure_ptr) */
-#ifdef RTEMS_UNIX
-#include <stdio.h> /* for setvbuf() */
+/*
+ * NOTE: When using RTEMS fake stat, fstat, and isatty, all output
+ * is line buffered so this setvbuf is not necessary. This
+ * setvbuf insures that we can redirect the output of a test
+ * on the UNIX simulator and it is in the same order as for a
+ * real target.
+ * NOTE:
+ * There is some problem with doing this on the hpux version
+ * of the UNIX simulator (symptom is printf core dumps), so
+ * we just don't for now.
+ * Not sure if this is a problem with hpux, newlib, or something else.
+ */
+
+#if defined(RTEMS_UNIX) && !defined(hpux)
+#define NEED_SETVBUF
+#endif
+
+#ifdef NEED_SETVBUF
+#include <stdio.h>
#endif
#include "internal.h"
@@ -196,18 +202,19 @@ libc_delete_hook(rtems_tcb *current_task,
if (current_task == deleted_task)
{
- ptr = _REENT;
+ ptr = _REENT;
}
else
{
- ptr = (struct _reent *) MY_task_get_note(deleted_task, LIBC_NOTEPAD);
+ ptr = (struct _reent *) MY_task_get_note(deleted_task, LIBC_NOTEPAD);
}
/* if (ptr) */
if (ptr && ptr != &libc_global_reent)
{
- _wrapup_reent(ptr);
- _reclaim_reent(ptr);
+ _wrapup_reent(ptr);
+ _reclaim_reent(ptr);
+ free(ptr);
}
MY_task_set_note(deleted_task, LIBC_NOTEPAD, 0);
@@ -218,7 +225,7 @@ libc_delete_hook(rtems_tcb *current_task,
if (current_task == deleted_task)
{
- _REENT = 0;
+ _REENT = 0;
}
}