stdlib.h: add labs()
[neatlibc.git] / stdlib.c
blob535c415385ed052ae891d4e0494026e7c68d6638
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 long labs(long n)
18 return n >= 0 ? n : -n;
21 char *getenv(char *name)
23 char **p = environ;
24 int len = strlen(name);
25 for (; *p; p++)
26 if (!memcmp(name, *p, len) && (*p)[len] == '=')
27 return *p + len + 1;
28 return NULL;