00001 /* Ensure that the executable of a running process cannot be 00002 modified. */ 00003 00004 #include <syscall.h> 00005 #include "tests/lib.h" 00006 #include "tests/main.h" 00007 00008 void 00009 test_main (void) 00010 { 00011 int handle; 00012 char buffer[16]; 00013 00014 CHECK ((handle = open ("rox-simple")) > 1, "open \"rox-simple\""); 00015 CHECK (read (handle, buffer, sizeof buffer) == (int) sizeof buffer, 00016 "read \"rox-simple\""); 00017 CHECK (write (handle, buffer, sizeof buffer) == 0, 00018 "try to write \"rox-simple\""); 00019 }