Ejemplo n.º 1
0
int main(int args, char **argv) {
    RegexIsFunny *regexTest = new RegexIsFunny();
    float quantity[4];
    float price[5];

    if (!CHECK_ARGS(args)) {
        std::cerr << "NOT ENOUGH ARGS" << std::endl;
        exit (84);
    }

    for (int i = 1; i < 5; ++i) {
        quantity[i - 1] = regexTest->checkQuantity(argv[i]);
    }

    for (int i = 5; i < 10; ++i) {
        price[i - 5] = regexTest->checkPrice(argv[i]);
    }

    Simplex toto(price, quantity);
    toto.algorithm();
    toto.display_result(price);
    delete regexTest;
    
    return 0;
}
Ejemplo n.º 2
0
/**
   process_stdout_read : 'process -> buf:string -> pos:int -> len:int -> int
   <doc>
   Read up to [len] bytes in [buf] starting at [pos] from the process stdout.
   Returns the number of bytes readed this way. Raise an exception if this
   process stdout is closed and no more data is available for reading.

        For hxcpp, the input buffer is in bytes, not characters
   </doc>
**/
static value process_stdout_read( value vp, value str, value pos, value len ) {
   CHECK_ARGS();
   gc_enter_blocking();
#   ifdef NEKO_WINDOWS
   {
      DWORD nbytes;
      if( !ReadFile(p->oread,buffer_data(buf)+val_int(pos),val_int(len),&nbytes,NULL) )
      {
         gc_exit_blocking();
         return alloc_null();
      }
      gc_exit_blocking();
      return alloc_int(nbytes);
   }
#   else
   int nbytes = read(p->oread,buffer_data(buf) + val_int(pos),val_int(len));
   if( nbytes <= 0 )
   {
      gc_exit_blocking();
      alloc_null();
   }
   gc_exit_blocking();
   return alloc_int(nbytes);
#   endif
}
Ejemplo n.º 3
0
/* usage: CounterFile path */
MODRET set_counterfile(cmd_rec *cmd) {
  config_rec *c;
  const char *path;

  CHECK_ARGS(cmd, 1);
  CHECK_CONF(cmd, CONF_ROOT|CONF_VIRTUAL|CONF_GLOBAL|CONF_ANON|CONF_DIR);

  path = cmd->argv[1];
  if (*path != '/') {
    CONF_ERROR(cmd, "must be an absolute path");
  }

  /* In theory, we could open a filehandle on the configured path right
   * here, and fail if the file couldn't be created/opened.  Then we
   * could just stash that filehandle in the cmd_rec.  Easy.
   *
   * However, that would mean that we would have open descriptors for
   * vhosts to which the client may not connect.  We would also need to
   * use pr_fs_get_usable_fd() so that these filehandles don't use the wrong
   * fds.  Instead, then, we wait to open the filehandles in sess_init(),
   * where we know vhost to which the client connected.
   */

  c = add_config_param_str(cmd->argv[0], 1, path);
  c->flags |= CF_MERGEDOWN;

  return PR_HANDLED(cmd);
}
Ejemplo n.º 4
0
static void
info_mach_thread_command (char *args, int from_tty)
{
  union
  {
    struct thread_basic_info basic;
  } thread_info_data;

  thread_t thread;
  kern_return_t result;
  unsigned int info_count;

  CHECK_ARGS (_("Thread"), args);
  sscanf (args, "0x%x", &thread);

  printf_unfiltered (_("THREAD_BASIC_INFO\n"));
  info_count = THREAD_BASIC_INFO_COUNT;
  result = thread_info (thread,
			THREAD_BASIC_INFO,
			(thread_info_t) & thread_info_data.basic,
			&info_count);
  MACH_CHECK_ERROR (result);

#if 0
  PRINT_FIELD (&thread_info_data.basic, user_time);
  PRINT_FIELD (&thread_info_data.basic, system_time);
#endif
  PRINT_FIELD (&thread_info_data.basic, cpu_usage);
  PRINT_FIELD (&thread_info_data.basic, run_state);
  PRINT_FIELD (&thread_info_data.basic, flags);
  PRINT_FIELD (&thread_info_data.basic, suspend_count);
  PRINT_FIELD (&thread_info_data.basic, sleep_time);
}
Ejemplo n.º 5
0
static void
info_mach_ports_command (char *args, int from_tty)
{
  port_name_array_t port_names_data;
  port_type_array_t port_types_data;
  unsigned int name_count, type_count;
  kern_return_t result;
  int index;
  task_t task;

  CHECK_ARGS ("Task", args);
  sscanf (args, "0x%x", &task);

  result = port_names (task,
                       &port_names_data,
                       &name_count, &port_types_data, &type_count);
  MACH_CHECK_ERROR (result);

  CHECK_FATAL (name_count == type_count);

  printf_unfiltered ("Ports for task %#x:\n", task);
  for (index = 0; index < name_count; ++index)
    {
      printf_unfiltered ("port name: %#x, type %#x\n",
                         port_names_data[index], port_types_data[index]);
    }

  vm_deallocate (task_self (), (vm_address_t) port_names_data,
                 (name_count * sizeof (mach_port_t)));
  vm_deallocate (task_self (), (vm_address_t) port_types_data,
                 (type_count * sizeof (mach_port_type_t)));
}
Ejemplo n.º 6
0
/* usage: MemcacheConnectFailures count */
MODRET set_memcacheconnectfailures(cmd_rec *cmd) {
  char *ptr = NULL;
  config_rec *c;
  uint64_t count = 0;

  CHECK_ARGS(cmd, 1);
  CHECK_CONF(cmd, CONF_ROOT|CONF_VIRTUAL|CONF_GLOBAL);

#ifdef HAVE_STRTOULL
  count = strtoull(cmd->argv[1], &ptr, 10);
#else
  count = strtoul(cmd->argv[1], &ptr, 10);
#endif /* HAVE_STRTOULL */

  if (ptr &&
      *ptr) {
    CONF_ERROR(cmd, pstrcat(cmd->tmp_pool, "bad connect failures parameter: ",
      cmd->argv[1], NULL));
  }

  c = add_config_param(cmd->argv[0], 1, NULL);
  c->argv[0] = palloc(c->pool, sizeof(uint64_t));
  *((uint64_t *) c->argv[0]) = count;

  return PR_HANDLED(cmd);
}
Ejemplo n.º 7
0
/* usage:
 *  CounterMaxReaders max
 *  CounterMaxWriters max
 */
MODRET set_countermaxreaderswriters(cmd_rec *cmd) {
  int count;
  config_rec *c;

  CHECK_ARGS(cmd, 1);
  CHECK_CONF(cmd, CONF_ROOT|CONF_VIRTUAL|CONF_GLOBAL|CONF_ANON|CONF_DIR);

  /* A count of zero means that an unlimited number of readers (or writers),
   * as is the default without this module, is in effect.
   */

  count = atoi(cmd->argv[1]);
  if (count < 0 ||
      count > INT_MAX) {
    CONF_ERROR(cmd, pstrcat(cmd->tmp_pool, "invalid number: ", cmd->argv[1],
      NULL));
  }

  c = add_config_param(cmd->argv[0], 1, NULL);
  c->argv[0] = pcalloc(c->pool, sizeof(int));
  *((int *) c->argv[0]) = count;
  c->flags |= CF_MERGEDOWN;

  return PR_HANDLED(cmd);
}
Ejemplo n.º 8
0
/* usage: ModulePath path */
MODRET set_modulepath(cmd_rec *cmd) {
  int res;
  struct stat st;

  CHECK_ARGS(cmd, 1);
  CHECK_CONF(cmd, CONF_ROOT);

  if (pr_fs_valid_path(cmd->argv[1]) < 0)
    CONF_ERROR(cmd, "must be an absolute path");

  /* Make sure that the configured path is not world-writeable. */
  res = pr_fsio_stat(cmd->argv[1], &st);
  if (res < 0)
    CONF_ERROR(cmd, pstrcat(cmd->tmp_pool, "error checking '",
      cmd->argv[1], "': ", strerror(errno), NULL)); 

  if (!S_ISDIR(st.st_mode))
    CONF_ERROR(cmd, pstrcat(cmd->tmp_pool, cmd->argv[1], " is not a directory",
      NULL));

  if (st.st_mode & S_IWOTH)
    CONF_ERROR(cmd, pstrcat(cmd->tmp_pool, cmd->argv[1], " is world-writable",
      NULL));

  if (lt_dlsetsearchpath(cmd->argv[1]) < 0)
    CONF_ERROR(cmd, pstrcat(cmd->tmp_pool, "error setting module path: ",
      lt_dlerror(), NULL));

  dso_module_path = pstrdup(dso_pool, cmd->argv[1]);
  return PR_HANDLED(cmd);
}
Ejemplo n.º 9
0
/* usage: ModuleControlsACLs actions|all allow|deny user|group list */
MODRET set_modulectrlsacls(cmd_rec *cmd) {
#ifdef PR_USE_CTRLS
  char *bad_action = NULL, **actions = NULL;

  CHECK_ARGS(cmd, 4);
  CHECK_CONF(cmd, CONF_ROOT);

  actions = ctrls_parse_acl(cmd->tmp_pool, cmd->argv[1]);

  if (strcmp(cmd->argv[2], "allow") != 0 &&
      strcmp(cmd->argv[2], "deny") != 0)
    CONF_ERROR(cmd, "second parameter must be 'allow' or 'deny'");

  if (strcmp(cmd->argv[3], "user") != 0 &&
      strcmp(cmd->argv[3], "group") != 0)
    CONF_ERROR(cmd, "third parameter must be 'user' or 'group'");

  bad_action = pr_ctrls_set_module_acls(dso_acttab, dso_pool, actions,
    cmd->argv[2], cmd->argv[3], cmd->argv[4]);
  if (bad_action != NULL)
    CONF_ERROR(cmd, pstrcat(cmd->tmp_pool, ": unknown action: '",
      bad_action, "'", NULL));

  return PR_HANDLED(cmd);
#else
  CONF_ERROR(cmd, "requires Controls support (--enable-ctrls)");
#endif
}
Ejemplo n.º 10
0
/* usage: TCPServiceName <name> */
MODRET set_tcpservicename(cmd_rec *cmd) {
  CHECK_ARGS(cmd, 1);
  CHECK_CONF(cmd, CONF_ROOT|CONF_VIRTUAL|CONF_GLOBAL);

  add_config_param_str(cmd->argv[0], 1, cmd->argv[1]);
  return HANDLED(cmd);
}
Ejemplo n.º 11
0
static void
info_mach_task_command (char *args, int from_tty)
{
  union
  {
    struct task_basic_info basic;
    struct task_events_info events;
    struct task_thread_times_info thread_times;
  } task_info_data;

  kern_return_t result;
  unsigned int info_count;
  task_t task;

  CHECK_ARGS ("Task", args);
  sscanf (args, "0x%x", &task);

  printf_unfiltered ("TASK_BASIC_INFO:\n");
  info_count = TASK_BASIC_INFO_COUNT;
  result = task_info (task,
                      TASK_BASIC_INFO,
                      (task_info_t) & task_info_data.basic, &info_count);
  MACH_CHECK_ERROR (result);

  PRINT_FIELD (&task_info_data.basic, suspend_count);
  PRINT_FIELD (&task_info_data.basic, virtual_size);
  PRINT_FIELD (&task_info_data.basic, resident_size);
#if 0
  PRINT_FIELD (&task_info_data.basic, user_time);
  PRINT_FIELD (&task_info_data.basic, system_time);
  printf_unfiltered ("\nTASK_EVENTS_INFO:\n");
  info_count = TASK_EVENTS_INFO_COUNT;
  result = task_info (task,
                      TASK_EVENTS_INFO,
                      (task_info_t) & task_info_data.events, &info_count);
  MACH_CHECK_ERROR (result);

  PRINT_FIELD (&task_info_data.events, faults);
  PRINT_FIELD (&task_info_data.events, zero_fills);
  PRINT_FIELD (&task_info_data.events, reactivations);
  PRINT_FIELD (&task_info_data.events, pageins);
  PRINT_FIELD (&task_info_data.events, cow_faults);
  PRINT_FIELD (&task_info_data.events, messages_sent);
  PRINT_FIELD (&task_info_data.events, messages_received);
#endif
  printf_unfiltered ("\nTASK_THREAD_TIMES_INFO:\n");
  info_count = TASK_THREAD_TIMES_INFO_COUNT;
  result = task_info (task,
                      TASK_THREAD_TIMES_INFO,
                      (task_info_t) & task_info_data.thread_times,
                      &info_count);
  MACH_CHECK_ERROR (result);

#if 0
  PRINT_FIELD (&task_info_data.thread_times, user_time);
  PRINT_FIELD (&task_info_data.thread_times, system_time);
#endif
}
Ejemplo n.º 12
0
static void
info_mach_port_command (char *args, int from_tty)
{
  task_t task;
  mach_port_t port;

  CHECK_ARGS ("Task and port", args);
  sscanf (args, "0x%x 0x%x", &task, &port);

  macosx_debug_port_info (task, port);
}
Ejemplo n.º 13
0
/* usage: CounterLog path|"none" */
MODRET set_counterlog(cmd_rec *cmd) {
  CHECK_ARGS(cmd, 1);
  CHECK_CONF(cmd, CONF_ROOT|CONF_VIRTUAL|CONF_GLOBAL);

  if (pr_fs_valid_path(cmd->argv[1]) < 0) {
    CONF_ERROR(cmd, "must be an absolute path");
  }

  add_config_param_str(cmd->argv[0], 1, cmd->argv[1]);
  return PR_HANDLED(cmd);
}
Ejemplo n.º 14
0
/* usage: DynMasqRefresh <seconds> */
MODRET set_dynmasqrefresh(cmd_rec *cmd) {
    CHECK_CONF(cmd, CONF_ROOT);
    CHECK_ARGS(cmd, 1);

    dynmasq_timer_interval = atoi(cmd->argv[1]);
    if (dynmasq_timer_interval < 1)
        CONF_ERROR(cmd, pstrcat(cmd->tmp_pool,
                                "must be greater than zero: '", cmd->argv[1], "'", NULL));

    return PR_HANDLED(cmd);
}
Ejemplo n.º 15
0
/* usage: LoadModule module */
MODRET set_loadmodule(cmd_rec *cmd) {

  CHECK_ARGS(cmd, 1);
  CHECK_CONF(cmd, CONF_ROOT);

  if (dso_load_module(cmd->argv[1]) < 0)
    CONF_ERROR(cmd, pstrcat(cmd->tmp_pool, "error loading module '",
      cmd->argv[1], "': ", strerror(errno), NULL));

  return PR_HANDLED(cmd);
}
Ejemplo n.º 16
0
/* usage: LoadFile path */
MODRET set_loadfile(cmd_rec *cmd) {

  CHECK_ARGS(cmd, 1);
  CHECK_CONF(cmd, CONF_ROOT);

  if (pr_fs_valid_path(cmd->argv[1]) < 0)
    CONF_ERROR(cmd, "must be an absolute path");

  if (dso_load_file(cmd->argv[1]) < 0)
    CONF_ERROR(cmd, pstrcat(cmd->tmp_pool, "error loading '", cmd->argv[1],
      "': ", strerror(errno), NULL));

  return PR_HANDLED(cmd);
}
MODRET set_lmd_ignore_memcached_down(cmd_rec *cmd) {
  int ignore = -1;

  CHECK_ARGS(cmd, 1);
  CHECK_CONF(cmd, CONF_ROOT|CONF_VIRTUAL|CONF_GLOBAL);

  ignore = get_boolean(cmd, 1);
  if (ignore == -1)
    CONF_ERROR(cmd, "expected Boolean parameter");

  if(ignore == TRUE) {
      ignore_memcached_down = true;
  }

  return PR_HANDLED(cmd);
}
Ejemplo n.º 18
0
/**
   process_stdin_write : 'process -> buf:string -> pos:int -> len:int -> int
   <doc>
   Write up to [len] bytes from [buf] starting at [pos] to the process stdin.
   Returns the number of bytes writen this way. Raise an exception if this
   process stdin is closed.
   </doc>
**/
static value process_stdin_write( value vp, value str, value pos, value len ) {
   CHECK_ARGS();
   gc_enter_blocking();
#   ifdef NEKO_WINDOWS
   DWORD nbytes;
   if( !WriteFile(p->iwrite,buffer_data(buf)+val_int(pos),val_int(len),&nbytes,NULL) )
#   else
   int nbytes = write(p->iwrite,buffer_data(buf)+val_int(pos),val_int(len));
   if( nbytes == -1 )
#   endif
   {
      gc_exit_blocking();
      return alloc_null();
   }
   gc_exit_blocking();
   return alloc_int(nbytes);
}
Ejemplo n.º 19
0
static int luaApi_destroyEntity(lua_State* L)
{
  int nArgs;
  CHECK_ARGS(nArgs, 1, L);

  if (lua_islightuserdata(L, 1))
  {
    Entity *entity = static_cast<Entity*>(lua_touserdata(L, 1));
    entity->destroy();
  }
  else
  {
    WRONG_PARAMS;
  }

  return 0;
}
Ejemplo n.º 20
0
static int luaApi_setIsSolid(lua_State* L)
{
  int nArgs;
  CHECK_ARGS(nArgs, 1, L);

  if (lua_islightuserdata(L, 1))
  {
    Entity *entity = static_cast<Entity*>(lua_touserdata(L, 1));
    entity->setIsSolid(true);
  }
  else
  {
    WRONG_PARAMS;
  }

  return 0;
}
Ejemplo n.º 21
0
/* usage: CopyEngine on|off */
MODRET set_copyengine(cmd_rec *cmd) {
  int engine = -1;
  config_rec *c;

  CHECK_ARGS(cmd, 1);
  CHECK_CONF(cmd, CONF_ROOT|CONF_VIRTUAL|CONF_GLOBAL);

  engine = get_boolean(cmd, 1);
  if (engine == -1) {
    CONF_ERROR(cmd, "expected Boolean parameter");
  }

  c = add_config_param(cmd->argv[0], 1, NULL);
  c->argv[0] = palloc(c->pool, sizeof(int));
  *((int *) c->argv[0]) = engine;

  return PR_HANDLED(cmd);
}
Ejemplo n.º 22
0
static int luaApi_setBoundingBox(lua_State* L)
{
  int nArgs;
  CHECK_ARGS(nArgs, 3, L);

  if (lua_islightuserdata(L, 1) && lua_isnumber(L, 2) && lua_isnumber(L, 3))
  {
    Entity *entity = static_cast<Entity*>(lua_touserdata(L, 1));
    int w = static_cast<int>(lua_tonumber(L, 2));
    int h = static_cast<int>(lua_tonumber(L, 3));
    entity->setBoundingBox(IBoundingBox(0, 0, w, h));
  }
  else
  {
    WRONG_PARAMS;
  }
  return 0;
}
Ejemplo n.º 23
0
static int luaApi_setPosition(lua_State* L)
{
  int nArgs;
  CHECK_ARGS(nArgs, 3, L);

  if (lua_islightuserdata(L, 1) && lua_isnumber(L, 2) && lua_isnumber(L, 3))
  {
    Entity *entity = static_cast<Entity*>(lua_touserdata(L, 1));
    int x = static_cast<int>(lua_tonumber(L, 2));
    int y = static_cast<int>(lua_tonumber(L, 3));
    entity->setPosition(x, y);
  }
  else
  {
    WRONG_PARAMS;
  }

  return 0;
}
Ejemplo n.º 24
0
sighandler_t SYSV_sigset(int signum, sighandler_t handler) {
    struct sigaction newact, oldact;
    sigset_t oldset;

    CHECK_ARGS(signum, handler);

    memset(&newact, 0, sizeof(newact));
    memset(&oldact, 0, sizeof(newact));

    if (handler == SIG_HOLD) {
        /* SIG_HOLD の場合 */
        /* シグナルマスクに signum を追加 */
        if (__sig_how_procmask(SIG_BLOCK, signum, &oldset) < 0) {
            return SIG_ERR;
        }
        /* signum の動作は変更しない (newact: NULL) */
        if (sigaction(signum, NULL, &oldact) < 0) {
            return SIG_ERR;
        }
        /* 呼び出し前に signum がブロックされていた場合は SIG_HOLD を返す */
        /* ブロックされていない場合は変更前の handler を返す */
	    return sigismember(&oldset, signum) ? SIG_HOLD : oldact.sa_handler;
    } else {
        /* SIG_HOLD 以外の場合 */
        /* signum の動作を handler (SIG_DFL, SIG_IGN 含む) にセット */
	    newact.sa_handler = handler;
        /* SYSV signal と違い、シグナル実行中は signum がブロックされる */
        if (sigaddset(&newact.sa_mask, signum) < 0) {
            return SIG_ERR;
        }
	    if (sigaction(signum, &newact, &oldact) < 0) {
	        return SIG_ERR;
	    }
        /* シグナルマスクから signum を取り除く */
	    if (__sig_how_procmask(SIG_UNBLOCK, signum, &oldset) < 0) {
	        return SIG_ERR;
	    }
        /* 呼び出し前に signum がブロックされていた場合は SIG_HOLD を返す */
        /* ブロックされていない場合は変更前の handler を返す */
	    return sigismember(&oldset, signum) ? SIG_HOLD : oldact.sa_handler;
    }
}
Ejemplo n.º 25
0
/**
	process_stdin_write : 'process -> buf:string -> pos:int -> len:int -> int
	<doc>
	Write up to [len] bytes from [buf] starting at [pos] to the process stdin.
	Returns the number of bytes writen this way. Raise an exception if this
	process stdin is closed.
	</doc>
**/
static value process_stdin_write( value vp, value str, value pos, value len ) {
	CHECK_ARGS();
#	ifdef NEKO_WINDOWS
	{
		DWORD nbytes;
		if( !WriteFile(p->iwrite,val_string(str)+val_int(pos),val_int(len),&nbytes,NULL) )
			neko_error();
		return alloc_int(nbytes);
	}
#	else
	int nbytes;
	POSIX_LABEL(stdin_write_again);
	nbytes = write(p->iwrite,val_string(str)+val_int(pos),val_int(len));
	if( nbytes == -1 ) {
		HANDLE_EINTR(stdin_write_again);
		neko_error();
	}
	return alloc_int(nbytes);
#	endif
}
Ejemplo n.º 26
0
static int luaApi_playSound(lua_State* L)
{
  int nArgs;
  CHECK_ARGS(nArgs, 1, L);
  if (lua_isstring(L, 1))
  {
    std::string soundPath = "Assets/" + std::string(lua_tostring(L, 1));

    SoundSystem::SoundHandler soundHandler = AssetManager::instance().getSound(soundPath);
    if (soundHandler != SoundSystem::INVALID_SOUND)
    {
      SoundSystem::instance().playSound(soundHandler);
    }
  }
  else
  {
    WRONG_PARAMS;
  }
  return 0;
}
Ejemplo n.º 27
0
static int luaApi_getPosition(lua_State* L)
{
  int nArgs;
  CHECK_ARGS(nArgs, 1, L);

  if (lua_islightuserdata(L, 1))
  {
    Entity *entity = static_cast<Entity*>(lua_touserdata(L, 1));
    int x = entity->getX();
    int y = entity->getY();

    lua_pushnumber(L, static_cast<lua_Number>(x));
    lua_pushnumber(L, static_cast<lua_Number>(y));
  }
  else
  {
    WRONG_PARAMS;
  }

  return 2;
}
Ejemplo n.º 28
0
int
main(int argc, char **argv)
{
    int    ret = 0;
    sem_t *sem;
   
    CHECK_ARGS(2, "<path>");
   
    sem = sem_open(argv[1], 0);
    if (sem == (sem_t *)SEM_FAILED) {
        perror("sem_open");
        exit(1);
    }
   
    if ((ret = sem_post(sem)) < 0)
        perror("sem_post");
   
    sem_close(sem);
   
    exit(ret);
}
Ejemplo n.º 29
0
sighandler_t SYSV_signal(int signum, sighandler_t handler) {
    struct sigaction newact, oldact;

    CHECK_ARGS(signum, handler);

    memset(&newact, 0, sizeof(newact));
    memset(&oldact, 0, sizeof(newact));

    newact.sa_handler = handler;
    /* SYSV signal の動作を設定する */
    /* a) ハンドラ起動時に処理方法がリセットされる */
    /* b) ハンドラ実行中に原因となったシグナルがブロックされない */
    /* c) ハンドラによって中断されたシステムコールが再開されない */
    newact.sa_flags  |= SA_RESETHAND;
    newact.sa_flags  |= SA_NODEFER;
    newact.sa_flags  &= ~SA_RESTART;
    if (sigaction(signum, &newact, &oldact) < 0) {
        return SIG_ERR;
    }
    return oldact.sa_handler;
}
Ejemplo n.º 30
0
/**
	process_stderr_read : 'process -> buf:string -> pos:int -> len:int -> int
	<doc>
	Read up to [len] bytes in [buf] starting at [pos] from the process stderr.
	Returns the number of bytes readed this way. Raise an exception if this
	process stderr is closed and no more data is available for reading.
	</doc>
**/
static value process_stderr_read( value vp, value str, value pos, value len ) {
	CHECK_ARGS();
#	ifdef NEKO_WINDOWS
	{
		DWORD nbytes;
		if( !ReadFile(p->eread,val_string(str)+val_int(pos),val_int(len),&nbytes,NULL) )
			neko_error();
		return alloc_int(nbytes);
	}
#	else
	int nbytes;
	POSIX_LABEL(stderr_read_again);
	nbytes = read(p->eread,val_string(str)+val_int(pos),val_int(len));
	if( nbytes < 0 ) {
		HANDLE_EINTR(stderr_read_again);
		neko_error();
	}
	if( nbytes == 0 )
		neko_error();
	return alloc_int(nbytes);
#	endif
}