00001 #include <sys/types.h>
00002 #include <sys/mman.h>
00003 #include <sys/stat.h>
00004 #include <fcntl.h>
00005 #include <errno.h>
00006 #include <fstream>
00007 #include "Exception.h"
00008 #include "Util.h"
00009
00010 using namespace std;
00011 using namespace Util;
00012
00013
00014 int main(int argc, char *argv[]) {
00015 try {
00016 Exception::Assert( argc==2, "Usage: %s <matrix id>\n", argv[0]);
00017 char *matrix_id = argv[1];
00018
00019
00020 int ret = shm_unlink(matrix_id);
00021 Exception::Assert(ret==0, "Error while deallocating shared memory: %s", strerror(errno));
00022 }
00023 catch(Exception *e) {
00024 cerr << e->GetMessage() << endl;
00025 return 1;
00026 }
00027
00028 return 0;
00029 }