PAPI 7.1.0.0
Loading...
Searching...
No Matches
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

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 29 of file fork.c.

30{
31 int retval;
32 int status;
33
34 tests_quiet( argc, argv ); /* Set TESTS_QUIET variable */
35
37 if ( retval != PAPI_VER_CURRENT )
38 test_fail( __FILE__, __LINE__, "main PAPI_library_init", retval );
39
40 if ( fork( ) == 0 ) {
42 if ( retval != PAPI_VER_CURRENT )
43 test_fail( __FILE__, __LINE__, "forked PAPI_library_init", retval );
44 exit( 0 );
45 } else {
46 wait( &status );
47 if ( WEXITSTATUS( status ) != 0 )
48 test_fail( __FILE__, __LINE__, "fork", WEXITSTATUS( status ) );
49 }
50
51 test_pass( __FILE__ );
52
53 return 0;
54
55}
initialize the PAPI library.
#define PAPI_VER_CURRENT
Definition: f90papi.h:54
int tests_quiet(int argc, char **argv)
Definition: test_utils.c:376
void PAPI_NORETURN test_fail(const char *file, int line, const char *call, int retval)
Definition: test_utils.c:491
void PAPI_NORETURN test_pass(const char *filename)
Definition: test_utils.c:432
int retval
Definition: zero_fork.c:53
Here is the call graph for this function: