repo.or.cz
/
minix3.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Uninitialized vector entry?
[minix3.git]
/
lib
/
other
/
_sbrk.c
blob
9f95f5817357fbf3c4ee46415e2ec0b1076f62a1
1
#include <lib.h>
2
#define sbrk _sbrk
3
#include <unistd.h>
4
5
extern
char
*
_brksize
;
6
7
PUBLIC
char
*
sbrk
(
incr
)
8
int
incr
;
9
{
10
char
*
newsize
, *
oldsize
;
11
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
);
20
}