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 26 of file fork2.c.

00027 {
00028     int retval;
00029     int status;
00030 
00031     tests_quiet( argc, argv );  /* Set TESTS_QUIET variable */
00032 
00033     retval = PAPI_library_init( PAPI_VER_CURRENT );
00034     if ( retval != PAPI_VER_CURRENT )
00035         test_fail( __FILE__, __LINE__, "main PAPI_library_init", retval );
00036 
00037     if ( fork(  ) == 0 ) {
00038         PAPI_shutdown();
00039 
00040         retval = PAPI_library_init( PAPI_VER_CURRENT );
00041         if ( retval != PAPI_VER_CURRENT )
00042             test_fail( __FILE__, __LINE__, "forked PAPI_library_init", retval );
00043         exit( 0 );
00044     } else {
00045         wait( &status );
00046         if ( WEXITSTATUS( status ) != 0 )
00047             test_fail( __FILE__, __LINE__, "fork", WEXITSTATUS( status ) );
00048     }
00049 
00050     test_pass( __FILE__, NULL, 0 );
00051     exit( 1 );
00052 }

Here is the call graph for this function:


Generated on 8 Sep 2016 for PAPI by  doxygen 1.6.1