prepare for aalloc.c, which I have just written myself, as an area-based

allocator using malloc and free, with mmap malloc and omalloc in mind,
not counterfeiting its security measures such as guard pages, and having
some of our own, e.g. XOR random cookies, optional mprotect, etc.

zero cost (for we have arc4random())
This commit is contained in:
tg
2008-11-12 04:55:19 +00:00
parent 8d5d720f08
commit 3c1e46ee4d
4 changed files with 479 additions and 5 deletions

6
main.c
View File

@ -13,7 +13,7 @@
#include <locale.h>
#endif
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.109 2008/11/12 00:54:49 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.110 2008/11/12 04:55:18 tg Exp $");
extern char **environ;
@ -76,6 +76,10 @@ main(int argc, const char *argv[])
char *cp;
#endif
#if !HAVE_ARC4RANDOM
change_random((unsigned long)time(NULL) * getpid());
#endif
/* make sure argv[] is sane */
if (!*argv) {
static const char *empty_argv[] = {