Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Functions
exec.h File Reference
#include "target.h"
Include dependency graph for exec.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int get_signo (const char *signame)
 
const char * get_signame (int signo)
 
void exec_file (const struct target_opts *options, struct target_status *result)
 

Function Documentation

◆ exec_file()

void exec_file ( const struct target_opts *  options,
struct target_status *  result 
)

Entry point to the child process (watchdog) subsystem.

On UNIX systems, this method fork ()s, creating a child process. This child process becomes a process group leader, redirects input and output files, then exec ()s the target specified in argv [0], providing it with argv to use as its argv array. Meanwhile, the parent process calls the wait_for_child method to monitor the child process, passing the return value back to the calling method.

On Windows, this method creates a process using the windows CreateProcess API call. The startup context for this process is based on the context of the exec utility, but with the standard * file handles redirected. The execution of the process is monitored with the WaitForSingleObject API call. If the process doesn't complete within the allowed timeout, it is then killed. On Windows NT systems, a soft kill of the process (via the GenerateConsoleCtrlEvent API call) are first attempted attempted. The process is then hard killed via the TerminateProcess API call.

Parameters
exec_namename of the child executable
argvargv array for child process
Returns
structure describing how the child procees exited
See also
wait_for_child ()

Definition at line 807 of file exec.cpp.

◆ get_signame()

const char * get_signame ( int  signo)

Translates a signal number into a human understandable name

Parameters
signoa signal number
Returns
the human understandable name for the signal (minus the SIG prefix), or "#n" if the the name for the number is unknown to the function, where n is signo
See also
signal_names []

Definition at line 397 of file exec.cpp.

◆ get_signo()

int get_signo ( const char *  signame)

exec.h - Interface declaration for the child process subsystem

$Id$

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Translates a human understandable signal name into a number usable by kill ().

This method understands several formats for signal names. They are as follows:

  • n
  • SIGFOO
  • FOO In this list, n denotes a number and FOO denotes a short signal name.
Parameters
signamea signal name to decode
Returns
the signal number or -1 if a number couldn't be determined
See also
signal_names []

Definition at line 365 of file exec.cpp.