Beispiel #1
0
static int
my_handler(int task, int arg1, int arg2, int ipctype, u_int envid, void* d)
{
  int i=0;
 
  if (arg1 == 16)
  {
    printf("server: 16 received\n");
    for(i=0; i<500000; i++)
      sys_null();
    printf("server: done, 16\n");
  }

  else if (arg1 == 15)
  {
    printf("server: 15 received\n");
    for(i=0; i<1000000; i++)
      sys_null();
    sys_set_allowipc1(XOK_IPC_BLOCKED);
    printf("server: done, 15\n");
  }

  else if (arg1 == 14)
  {
    printf("server: 14 received\n");
    for(i=0; i<500000; i++)
      sys_null();
    printf("server: done, 14\n");
  }

  else if (arg1 == 13)
  {
    printf("server: 13 received\n");
    
    for(i=0; i<500000; i++)
      sys_null();

    printf("server: done, 13\n");
  }

  else if (arg1 == 12)
  {
    printf("server: 12 received, program not available\n");
    RETERR(V_PROGUNAVAIL);
  }

  return arg1;
}
Beispiel #2
0
static void ipcdemux_init() {
  ipc1_in = ipc1_demux;
  UAREA.u_entipc1 = (u_int)&ipc1_entry;
  sys_set_allowipc1(XOK_IPC_ALLOWED);
  ipcdemux_inited = 1;
}