From 4f670845ff9ab6c48bcb5f7bf4d4ef6dc3c3064b Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 27 Mar 2012 11:51:08 +0200 Subject: reorganize file structure to match the upstream requirements --- pintos-progos/examples/mcat.c | 45 ------------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 pintos-progos/examples/mcat.c (limited to 'pintos-progos/examples/mcat.c') diff --git a/pintos-progos/examples/mcat.c b/pintos-progos/examples/mcat.c deleted file mode 100644 index 7b39760..0000000 --- a/pintos-progos/examples/mcat.c +++ /dev/null @@ -1,45 +0,0 @@ -/* mcat.c - - Prints files specified on command line to the console, using - mmap. */ - -#include -#include - -int -main (int argc, char *argv[]) -{ - int i; - - for (i = 1; i < argc; i++) - { - int fd; - mapid_t map; - void *data = (void *) 0x10000000; - int size; - - /* Open input file. */ - fd = open (argv[i]); - if (fd < 0) - { - printf ("%s: open failed\n", argv[i]); - return EXIT_FAILURE; - } - size = filesize (fd); - - /* Map files. */ - map = mmap (fd, data); - if (map == MAP_FAILED) - { - printf ("%s: mmap failed\n", argv[i]); - return EXIT_FAILURE; - } - - /* Write file to console. */ - write (STDOUT_FILENO, data, size); - - /* Unmap files (optional). */ - munmap (map); - } - return EXIT_SUCCESS; -} -- cgit v1.2.3