Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'libgloss/libnosys/sbrk.c')
-rw-r--r--libgloss/libnosys/sbrk.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/libgloss/libnosys/sbrk.c b/libgloss/libnosys/sbrk.c
index 39f411cdd..8091d7083 100644
--- a/libgloss/libnosys/sbrk.c
+++ b/libgloss/libnosys/sbrk.c
@@ -1,21 +1,27 @@
-/* Version of sbrk for no operating system. */
+/*
+ * Version of sbrk for no operating system.
+ */
#include "config.h"
+#include <_ansi.h>
#include <_syslist.h>
+#include <sys/types.h>
+#include <errno.h>
+#undef errno
+extern int errno;
-void *
-_sbrk (incr)
- int incr;
+caddr_t
+_DEFUN (_sbrk, (incr),
+ int incr)
{
- extern char end; /* Set by linker. */
- static char * heap_end;
- char * prev_heap_end;
-
- if (heap_end == 0)
- heap_end = & end;
+ extern char end; /* set by linker */
+ static char *heap_end;
+ char *prev_heap_end;
+ if (heap_end == 0) {
+ heap_end = &end;
+ }
prev_heap_end = heap_end;
heap_end += incr;
-
- return (void *) prev_heap_end;
+ return (caddr_t) prev_heap_end;
}