int main(int argc, const char** argv)
{
    int return_result = 0;
    // renice and strip of suid rights

    if (nice(-10) == -1)
    {
        fprintf(stderr, "warning: could not increase priority (no setuid?)\n");
    }

    if (getuid() != geteuid())
    {
        if (setuid(getuid()) != 0)
        {
            fprintf(stderr, "warning: could not switch back to uid=%d\n", getuid());
        }
    }
    try
    {
        core_config my_conf(argv, argc);
        // setup input and output
        magnexgrad_core my_core(my_conf);
        // start core application
        my_core.run();
    }
    catch (const DamarisException& e)
    {
        fprintf(stderr, "%s\n", e.what());
        return_result = 1;
    }
    return return_result;
}
예제 #2
0
int main(int argc, const char** argv)
{
    int return_result = 0;
    try
    {
        core_config my_conf(argv, argc);
        // setup input and output
        Mobile_core my_core(my_conf);
        // start core application
        my_core.run();
    }
    catch (const DamarisException& e)
    {
        fprintf(stderr, "%s\n", e.what());
        return_result = 1;
    }
    return return_result;
}
예제 #3
0
파일: main.c 프로젝트: ubertil/my_projects
int		main(int ac, char **av, char **env)
{
  t_shell	*shell;
  t_check	check[4];
  int		return_value;

  if ((shell = malloc(sizeof(t_shell))) == NULL)
    return (1);
  if (env[0] != NULL)
    copy_env(shell, env);
  shell->status = 0;
  init_check(check);
  return_value = my_core(shell, check);
  (void)ac;
  (void)av;
  my_putstr("exit\n");
  free_all_on_exit(shell);
  return (return_value);
}
예제 #4
0
int main( int argc,const char** argv ) {
    fprintf(stderr,"!!!CAUTION: you are using a test case!!!\n");
    int return_result=0;
    try {
	core_config my_config(argv, argc);
	// setup input and output
	dummycore my_core(my_config);
	// start core application
	my_core.run();
    }
    catch(ADC_exception ae) {
	fprintf(stderr,"adc: %s\n",ae.c_str());
	return_result=1;
    }
    catch(core_exception ce) {
	fprintf(stderr,"core: %s\n",ce.c_str());
	return_result=1;
    }
    return return_result;
}
int main(int argc, const char** argv) {
  int return_result=0;
  // renice and strip of suid rights

  if (nice(-10)==-1) {
    fprintf(stderr, "warning: could not increase priority (no setuid?)\n");
  }

  if (getuid()!=geteuid()) {
    if (setuid(getuid())!=0) {
      fprintf(stderr, "warning: could not switch back to uid=%d\n",getuid());
    }
  }
  try {
      core_config my_conf(argv, argc);
      // setup input and output
      magnexgrad_core my_core(my_conf);
      // start core application
      my_core.run();
  }
  catch(ADC_exception ae) {
    fprintf(stderr,"adc: %s\n",ae.c_str());
    return_result=1;
  }
  catch(core_exception ce) {
    fprintf(stderr,"core: %s\n",ce.c_str());
    return_result=1;
  }
  catch(pulse_exception pe) {
    fprintf(stderr,"pulse: %s\n",pe.c_str());
    return_result=1;
  }
  catch (tempcont_error te) {
    fprintf(stderr,"temperature control: %s\n",te.c_str());
    return_result=1;
  }
  return return_result;
}
예제 #6
0
int main(int argc, const char** argv) {
  int return_result=0;
  try {
      core_config my_conf(argv, argc);
      // setup input and output
      NQR_core my_core(my_conf);
      // start core application
      my_core.run();
  }
  catch(ADC_exception ae) {
    fprintf(stderr,"adc: %s\n",ae.c_str());
    return_result=1;
  }
  catch(core_exception ce) {
    fprintf(stderr,"core: %s\n",ce.c_str());
    return_result=1;
  }
  catch(pulse_exception pe) {
    fprintf(stderr,"pulse: %s\n",pe.c_str());
    return_result=1;
  }
  return return_result;
}
예제 #7
0
u_int64 Thread_Memory_Semantics::my_rank_mask() {
  assert(cores_are_initialized());
  return my_core()->rank_mask();
}