repo.or.cz
/
newlib-cygwin.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Cygwin: Add new APIs tc[gs]etwinsize()
[newlib-cygwin.git]
/
newlib
/
libc
/
sys
/
sysvi386
/
sbrk.c
blob
8ae3ed12b5df3fdc6dab96517acd01aff535ca06
1
extern
end
;
2
3
static void
*
curbrk
= (
char
*)&
end
;
4
5
void
*
6
sbrk
(
incr
)
7
int
incr
; {
8
extern
int
errno
;
9
extern
int
_brk
(
void
*);
10
void
*
ptr
=
curbrk
;
11
int
t
;
12
13
if
(
incr
==
0
)
14
return
curbrk
;
15
t
=
_brk
(
curbrk
+
incr
);
16
if
(
t
== -
1
&&
errno
)
17
return
(
void
*)-
1
;
18
curbrk
= ((
char
*)
curbrk
) +
incr
;
19
return
ptr
;
20
}
21