Uninitialized vector entry?
[minix3.git] / lib / other / _sbrk.c
blob9f95f5817357fbf3c4ee46415e2ec0b1076f62a1
1 #include <lib.h>
2 #define sbrk _sbrk
3 #include <unistd.h>
5 extern char *_brksize;
7 PUBLIC char *sbrk(incr)
8 int incr;
10 char *newsize, *oldsize;
12 oldsize = _brksize;
13 newsize = _brksize + incr;
14 if ((incr > 0 && newsize < oldsize) || (incr < 0 && newsize > oldsize))
15 return( (char *) -1);
16 if (brk(newsize) == 0)
17 return(oldsize);
18 else
19 return( (char *) -1);