PAPI  5.3.2.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
forkexec4.c File Reference
Include dependency graph for forkexec4.c:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 26 of file forkexec4.c.

27 {
28  int retval;
29  int status;
30 
31  tests_quiet( argc, argv ); /* Set TESTS_QUIET variable */
32 
33  if ( ( argc > 1 ) && ( strcmp( argv[1], "xxx" ) == 0 ) ) {
35  if ( retval != PAPI_VER_CURRENT )
36  test_fail( __FILE__, __LINE__, "execed PAPI_library_init", retval );
37  } else {
39  if ( retval != PAPI_VER_CURRENT )
40  test_fail( __FILE__, __LINE__, "main PAPI_library_init", retval );
41 
42  if ( fork( ) == 0 ) {
44  if ( retval != PAPI_VER_CURRENT )
45  test_fail( __FILE__, __LINE__, "forked PAPI_library_init",
46  retval );
47 
48  if ( execlp( argv[0], argv[0], "xxx", NULL ) == -1 )
49  test_fail( __FILE__, __LINE__, "execlp", PAPI_ESYS );
50  } else {
51  wait( &status );
52  if ( WEXITSTATUS( status ) != 0 )
53  test_fail( __FILE__, __LINE__, "fork", WEXITSTATUS( status ) );
54  }
55  }
56 
57  test_pass( __FILE__, NULL, 0 );
58  exit( 1 );
59 }
tests_quiet(argc, argv)
test_pass(__FILE__, NULL, 0)
int int argc
Definition: iozone.c:1609
char ** argv
Definition: iozone.c:1610
test_fail(__FILE__, __LINE__,"PAPI_library_init", retval)
int PAPI_library_init(int version)
Definition: papi.c:495
int wait()
#define PAPI_VER_CURRENT
Definition: fpapi.h:14
#define PAPI_ESYS
Definition: fpapi.h:108
long long status
Definition: iozone.c:1335
ssize_t retval
Definition: libasync.c:338
void exit()

Here is the call graph for this function: