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.

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

Here is the call graph for this function:


Generated on 17 Nov 2016 for PAPI by  doxygen 1.6.1