2004-01-10 21:18:25 +00:00
|
|
|
/*
|
2007-03-29 01:00:33 +00:00
|
|
|
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
2005-11-05 19:57:48 +00:00
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2004-11-28 20:09:25 +00:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 12:43:37 +00:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2004-11-22 01:38:40 +00:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
2004-01-10 21:18:25 +00:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
2005-07-04 00:13:44 +00:00
|
|
|
#ifndef OPAL_FEW_H
|
|
|
|
#define OPAL_FEW_H
|
|
|
|
|
2009-03-17 01:45:19 +00:00
|
|
|
#include "opal_config.h"
|
|
|
|
|
2004-10-20 22:31:03 +00:00
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
2004-01-12 02:07:42 +00:00
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2004-08-17 03:06:39 +00:00
|
|
|
/**
|
|
|
|
* Forks, execs, and waits for a subordinate program
|
|
|
|
*
|
|
|
|
* @param argv Null-terminated argument vector; argv[0] is the program
|
|
|
|
* (same as arguments to execvp())
|
|
|
|
*
|
|
|
|
* @param status Upon success, will be filled with the return status
|
|
|
|
* from waitpid(2). The WIF* macros can be used to examine the value
|
|
|
|
* (see waitpid(2)).
|
|
|
|
*
|
2006-02-12 01:33:29 +00:00
|
|
|
* @retval OPAL_SUCCESS If the child launched and exited.
|
|
|
|
* @retval OPAL_ERR_IN_ERRNO If a failure occurred, errno should be
|
2004-08-17 03:06:39 +00:00
|
|
|
* examined for the specific error.
|
|
|
|
*
|
|
|
|
* This function forks, execs, and waits for an executable to
|
|
|
|
* complete. The input argv must be a NULL-terminated array (perhaps
|
2006-02-12 01:33:29 +00:00
|
|
|
* built with the opal_arr_*() interface). Upon success, OPAL_SUCCESS
|
2004-08-17 03:06:39 +00:00
|
|
|
* is returned. This function will wait either until the child
|
|
|
|
* process has exited or waitpid() returns an error other than EINTR.
|
|
|
|
*
|
2006-02-12 01:33:29 +00:00
|
|
|
* Note that a return of OPAL_SUCCESS does \em not imply that the child
|
2004-08-17 03:06:39 +00:00
|
|
|
* process exited successfully -- it simply indicates that the child
|
|
|
|
* process exited. The WIF* macros (see waitpid(2)) should be used to
|
|
|
|
* examine the status to see hold the child exited.
|
2004-09-27 19:38:23 +00:00
|
|
|
*
|
2005-07-04 00:13:44 +00:00
|
|
|
* \warning This function should not be called if \c orte_init()
|
2004-09-27 19:38:23 +00:00
|
|
|
* or \c MPI_Init() have been called. This function is not
|
|
|
|
* safe in a multi-threaded environment in which a handler
|
|
|
|
* for \c SIGCHLD has been registered.
|
2004-08-17 03:06:39 +00:00
|
|
|
*/
|
2006-08-20 15:54:04 +00:00
|
|
|
OPAL_DECLSPEC int opal_few(char *argv[], int *status);
|
2004-01-10 21:18:25 +00:00
|
|
|
|
2004-10-20 22:31:03 +00:00
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
2004-01-12 02:07:42 +00:00
|
|
|
}
|
|
|
|
#endif
|
2007-03-29 01:00:33 +00:00
|
|
|
#endif /* OPAL_FEW_H */
|