2008-08-06 18:36:30 +00:00
|
|
|
// This file is part of BOINC.
|
2005-01-20 23:22:22 +00:00
|
|
|
// http://boinc.berkeley.edu
|
2008-08-06 18:36:30 +00:00
|
|
|
// Copyright (C) 2008 University of California
|
2003-08-15 00:45:25 +00:00
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// BOINC is free software; you can redistribute it and/or modify it
|
|
|
|
// under the terms of the GNU Lesser General Public License
|
|
|
|
// as published by the Free Software Foundation,
|
|
|
|
// either version 3 of the License, or (at your option) any later version.
|
2003-08-15 00:45:25 +00:00
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// BOINC is distributed in the hope that it will be useful,
|
2005-01-20 23:22:22 +00:00
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
// See the GNU Lesser General Public License for more details.
|
2002-12-03 18:57:40 +00:00
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
2002-12-03 18:57:40 +00:00
|
|
|
|
2007-07-05 23:06:18 +00:00
|
|
|
// show_shmem: display work_item part of shared-memory structure
|
|
|
|
|
2005-11-21 18:34:44 +00:00
|
|
|
#include "config.h"
|
2004-07-13 13:54:09 +00:00
|
|
|
#include <cstdio>
|
|
|
|
#include <cstdlib>
|
2008-02-27 23:26:38 +00:00
|
|
|
#include <string>
|
2002-09-26 23:12:13 +00:00
|
|
|
#include <unistd.h>
|
2002-06-01 20:26:21 +00:00
|
|
|
|
|
|
|
#include "shmem.h"
|
2003-08-15 00:45:25 +00:00
|
|
|
#include "sched_config.h"
|
2002-06-01 20:26:21 +00:00
|
|
|
#include "sched_shmem.h"
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
SCHED_SHMEM* ssp;
|
2008-02-03 21:46:30 +00:00
|
|
|
int retval;
|
2002-06-01 20:26:21 +00:00
|
|
|
void* p;
|
|
|
|
|
2006-11-03 21:42:49 +00:00
|
|
|
retval = config.parse_file(".");
|
2002-10-04 20:35:56 +00:00
|
|
|
if (retval) {
|
2006-01-19 21:46:25 +00:00
|
|
|
printf("can't parse config: %d\n", retval);
|
2002-10-04 20:35:56 +00:00
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
retval = attach_shmem(config.shmem_key, &p);
|
2002-06-01 20:26:21 +00:00
|
|
|
if (retval) {
|
2006-01-19 21:46:25 +00:00
|
|
|
printf("can't attach shmem: key %x\n", config.shmem_key);
|
2002-06-01 20:26:21 +00:00
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
ssp = (SCHED_SHMEM*)p;
|
|
|
|
retval = ssp->verify();
|
2007-07-05 23:06:18 +00:00
|
|
|
ssp->show(stdout);
|
2002-06-01 20:26:21 +00:00
|
|
|
}
|
2004-12-08 00:40:19 +00:00
|
|
|
|
2005-01-02 18:29:53 +00:00
|
|
|
const char *BOINC_RCSID_a370415aab = "$Id$";
|