Exemple #1
0
int main(int argc, char *argv[])
{
	/*int retvalue;*/
	if (system("./reply reply &> /dev/null") == -1)
		printf("system cmd failed\n");
	sleep(1);

	if (test_one())
		exit(1);

	if (test_two())
		exit(1);

    /*retvalue = init_memshare("memtest", SHMEMSIEZ, QUEUESIZE);*/
	data_register(data_callback);
	signal1_register(signal1_callback);
	signal2_register(signal2_callback);
	signal3_register(signal3_callback);

	sleep(2);

	if (test_three())
		exit(1);

	if (test_four())
		exit(1);

	if (test_five(LARGE_NUM))
		exit(1);

	if (test_five(LARGER_NUM) != 0)
		exit(1);

	if (test_five(LARGE_NUM))
		exit(1);

	if (test_six())
		exit(1);
	test_seven();

	data("reply", "exit\0", strlen("exit") + 1);
	return 0;
}
Exemple #2
0
int main(int argc, char *argv[])
{
	procname = malloc(256);
	strncpy(procname, argv[1], 256);

	set_print_level(0);
	printf("%s started\n", procname);

	if (init_memshare(procname,SHMEMSIZE , QUEUESIZE)) {
		printf("Failed to init memshare\n");
		exit(1);
	}
	data_register(data_callback);
	signal1_register(signal1_callback);
	signal2_register(signal2_callback);
	signal3_register(signal3_callback);

	while (1)
		sleep(3);
}
Exemple #3
0
int main(int argc, char *argv[])
{
	procname = malloc(256);
	strncpy(procname, argv[1], 256);

	printf("%s started\n", procname);
	if (init_memshare(procname, SHMEMSIZE, QUEUESIZE)) {
		printf("Failed to init memshare\n");
		if (strncmp(procname, "number_8", PROC_NAME_SIZE) == 0) {
			if (system("./memsend -s1 memshare 7") == -1)
				printf("system cmd failed\n");
		}
		exit(1);
	}
	data_register(data_callback);
	signal1_register(signal1_callback);
	signal2_register(signal2_callback);
	signal3_register(signal3_callback);

	while (1)
		sleep(3);
}