#include #include #include #include #include #define PAGE_SIZE 4096 int main(int argc, char *argv[]) { int fd; int *b; fd = open("/dev/dummy", O_RDWR); if (fd < 0) { perror("open"); return -1; } b = mmap(NULL, PAGE_SIZE, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0xFFFFFFFFFFFFF000); if (b == NULL) { perror("mmap"); return -1; } printf("%d\n", *b); return 0; }