12 #define FILE_LEN (4 * 4096)
14 int main(int argc
, char **argv
)
21 fd
= open("dummystream", O_RDWR
|O_CREAT
, S_IRUSR
|S_IWUSR
);
26 off
= posix_fallocate(fd
, 0, FILE_LEN
);
28 printf("Error in fallocate\n");
35 off
= lseek(fd
, FILE_LEN
- 1, SEEK_CUR
);
40 len
= write(fd
, "", 1);
47 base
= mmap(NULL
, FILE_LEN
, PROT_READ
|PROT_WRITE
,
56 *(uint32_t *) pos
= 0xC1FC1FC1;
57 pos
+= sizeof(uint32_t);
60 ret
= uuid_parse("2a6422d0-6cee-11e0-8c08-cb07d7b3a564", uuid
);
62 printf("uuid parse error\n");
65 memcpy(pos
, uuid
, 16);
69 *(uint32_t *) pos
= 0;
70 pos
+= sizeof(uint32_t);
72 ret
= munmap(base
, FILE_LEN
);
This page took 0.034439 seconds and 6 git commands to generate.