elf.h: fix 32-bit usage
[neatlibc.git] / stdlib.c
blob611362068bebb48fe849569479e8546706acb1a7
1 #include <stdlib.h>
2 #include <string.h>
4 char **environ;
6 void exit(int status)
8 _exit(status);
11 int abs(int n)
13 return n >= 0 ? n : -n;
16 char *getenv(char *name)
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;