PAPI  5.3.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
fork.c File Reference
Include dependency graph for fork.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 23 of file fork.c.

24 {
25  int retval;
26  int status;
27 
28  tests_quiet( argc, argv ); /* Set TESTS_QUIET variable */
29 
31  if ( retval != PAPI_VER_CURRENT )
32  test_fail( __FILE__, __LINE__, "main PAPI_library_init", retval );
33 
34  if ( fork( ) == 0 ) {
36  if ( retval != PAPI_VER_CURRENT )
37  test_fail( __FILE__, __LINE__, "forked PAPI_library_init", retval );
38  exit( 0 );
39  } else {
40  wait( &status );
41  if ( WEXITSTATUS( status ) != 0 )
42  test_fail( __FILE__, __LINE__, "fork", WEXITSTATUS( status ) );
43  }
44 
45  test_pass( __FILE__, NULL, 0 );
46  exit( 1 );
47 }
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
long long status
Definition: iozone.c:1335
ssize_t retval
Definition: libasync.c:338
void exit()

Here is the call graph for this function: