summaryrefslogtreecommitdiff
path: root/src/stdlib/_stdlib.h
blob: 089de7df5d64ef969945efc6df07a176046386b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef ___STDLIB_H__
#define ___STDLIB_H__

#include <stdlib.h>
#include <limits.h>

#define _rand(_n) \
	(((_n) = (_n) * 1103515245 + 12345) ? (_n) / UINT_MAX % RAND_MAX : 0)

struct __stdlib {
	struct atexit {
        	int nfns;
        	void (*fns[32])(void);
        	struct atexit *next;
        	struct atexit *prev;
	} atexit;
	unsigned int rand;
	char **environ;
};

extern struct __stdlib __stdlib;

#endif