/*
 * Copyright (C) 2000 TimeSys Corporation
 *
 * This 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 2 of the License, or (at your
 * option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * 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.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
 */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <sys/time.h>
#include <unistd.h>
#include <rk/rk.h>
#include <signal.h>

rk_resource_set_t rs;

void 
print_usage(char *cmdname){
  printf("Usage: %s <resource_set> \n", cmdname);
}

int 
main(int argc, char *argv[]){

  rk_reserve_t	cpu_rsv;

  if (argc != 2){
    print_usage(argv[0]);
    return -1;
  }
  
  if ((rs = (rk_resource_set_t)atoi(argv[1])) == NULL) {
    fprintf(stderr, "%s: could not create resource set.  TimeSys RK module loaded?\n", argv[0]);
    exit(-1);
  }


  cpu_rsv = rk_cpu_reserve_dummy_create(rs, 60);

  printf("Resource Set (0x%x)=(%d) CPU Reserve (0x%x)=(%d)\n", 
	 (int)rs, (int)rs, (int)cpu_rsv, (int)cpu_rsv);
  
  return (int)cpu_rsv; 
}
