xref: /haiku/src/bin/catarea.c (revision 1a76488fc88584bf66b9751d7fb9b6527ac20d87)
1 #include <stdio.h>
2 #include <OS.h>
3 
4 int main(int argc, char **argv)
5 {
6 	area_id area, cloned;
7 	char *ptr, *p;
8 	area_info ai;
9 
10 	if (argc < 2) {
11 		printf("catarea areaid\n");
12 		return 1;
13 	}
14 	area = atoi(argv[1]);
15 
16 	cloned = clone_area("cloned for catarea", (void **)&ptr, B_ANY_ADDRESS, B_READ_AREA, area);
17 	get_area_info(cloned, &ai);
18 	//fprintf(stderr, "copy of bios: size=0x%08lx\n", ai.size);
19 	write(1, ptr, ai.size);
20 	delete_area(cloned);
21 	return 0;
22 }
23