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

31 {
32  int retval;
33  int status;
34 
35  tests_quiet( argc, argv ); /* Set TESTS_QUIET variable */
36 
38  if ( retval != PAPI_VER_CURRENT )
39  test_fail( __FILE__, __LINE__, "main PAPI_library_init", retval );
40 
41  if ( fork( ) == 0 ) {
42  PAPI_shutdown();
43 
45  if ( retval != PAPI_VER_CURRENT )
46  test_fail( __FILE__, __LINE__, "forked PAPI_library_init", retval );
47  exit( 0 );
48  } else {
49  wait( &status );
50  if ( WEXITSTATUS( status ) != 0 )
51  test_fail( __FILE__, __LINE__, "fork", WEXITSTATUS( status ) );
52  }
53 
54  test_pass( __FILE__ );
55 
56  return 0;
57 
58 }
void test_pass(const char *filename)
Definition: test_utils.c:432
int int argc
Definition: iozone.c:1609
char ** argv
Definition: iozone.c:1610
int PAPI_library_init(int version)
Definition: papi.c:500
void PAPI_shutdown(void)
Definition: papi.c:4461
int wait()
long long status
Definition: iozone.c:1335
int tests_quiet(int argc, char **argv)
Definition: test_utils.c:376
void test_fail(const char *file, int line, const char *call, int retval)
Definition: test_utils.c:468
ssize_t retval
Definition: libasync.c:338
#define PAPI_VER_CURRENT
Definition: papi.h:225
void exit()

Here is the call graph for this function: