00001
00002
00003
00004
00005
00006 #include <debug.h>
00007 #include <syscall.h>
00008 #include "tests/lib.h"
00009 #include "tests/main.h"
00010 #include "tests/vm/qsort.h"
00011
00012 const char *test_name = "child-qsort";
00013
00014 int
00015 main (int argc UNUSED, char *argv[])
00016 {
00017 int handle;
00018 unsigned char buf[128 * 1024];
00019 size_t size;
00020
00021 quiet = true;
00022
00023 CHECK ((handle = open (argv[1])) > 1, "open \"%s\"", argv[1]);
00024
00025 size = read (handle, buf, sizeof buf);
00026 qsort_bytes (buf, sizeof buf);
00027 seek (handle, 0);
00028 write (handle, buf, size);
00029 close (handle);
00030
00031 return 72;
00032 }