00001 /* Mmaps a 128 kB file "sorts" the bytes in it, using quick sort, 00002 a multi-pass divide and conquer algorithm. */ 00003 00004 #include <debug.h> 00005 #include <syscall.h> 00006 #include "tests/lib.h" 00007 #include "tests/main.h" 00008 #include "tests/vm/qsort.h" 00009 00010 const char *test_name = "child-qsort-mm"; 00011 00012 int 00013 main (int argc UNUSED, char *argv[]) 00014 { 00015 int handle; 00016 unsigned char *p = (unsigned char *) 0x10000000; 00017 00018 quiet = true; 00019 00020 CHECK ((handle = open (argv[1])) > 1, "open \"%s\"", argv[1]); 00021 CHECK (mmap (handle, p) != MAP_FAILED, "mmap \"%s\"", argv[1]); 00022 qsort_bytes (p, 1024 * 128); 00023 00024 return 80; 00025 }