示例#1
0
文件: swapping01.c 项目: bsbrp/ltp
int main(int argc, char *argv[])
{
    int lc;

    tst_parse_opts(argc, argv, NULL, NULL);

#if __WORDSIZE == 32
    tst_brkm(TCONF, NULL, "test is not designed for 32-bit system.");
#endif

    setup();

    for (lc = 0; TEST_LOOPING(lc); lc++) {
        tst_count = 0;

        init_meminfo();

        switch (pid = fork()) {
        case -1:
            tst_brkm(TBROK | TERRNO, cleanup, "fork");
        case 0:
            do_alloc();
            exit(0);
        default:
            check_swapping();
        }
    }
    cleanup();
    tst_exit();
}
示例#2
0
文件: swapping01.c 项目: sathnaga/ltp
static void test_swapping(void)
{
#if __WORDSIZE == 32
	tst_brk(TCONF, "test is not designed for 32-bit system.");
#endif

	init_meminfo();

	switch (pid = SAFE_FORK()) {
		case 0:
			do_alloc();
			exit(0);
		default:
			check_swapping();
	}
}