repo.or.cz
/
neatlibc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
elf.h: fix 32-bit usage
[neatlibc.git]
/
stdlib.c
blob
611362068bebb48fe849569479e8546706acb1a7
1
#include <stdlib.h>
2
#include <string.h>
3
4
char
**
environ
;
5
6
void
exit
(
int
status
)
7
{
8
_exit
(
status
);
9
}
10
11
int
abs
(
int
n
)
12
{
13
return
n
>=
0
?
n
: -
n
;
14
}
15
16
char
*
getenv
(
char
*
name
)
17
{
18
char
**
p
=
environ
;
19
int
len
=
strlen
(
name
);
20
for
(; *
p
;
p
++)
21
if
(!
memcmp
(
name
, *
p
,
len
) && (*
p
)[
len
] ==
'='
)
22
return
*
p
+
len
+
1
;
23
return
NULL
;
24
}