Bug 497723 - forgot to restore callgrind output cleanup
[valgrind.git] / none / tests / mips32 / bug320057-mips32.c
blob857432fd2acd2e2b7b63c8a0ee01275492601b8f
1 #include <sys/types.h>
2 #include <sys/stat.h>
3 #include <fcntl.h>
4 #include <unistd.h>
5 #include "tests/sys_mman.h"
6 #include <errno.h>
7 #include <stdio.h>
8 #include <string.h>
10 /* Test case supplied by Vasile Floroiu. */
12 #define DO(cmd) printf(#cmd "; status: %s\n", strerror(errno))
13 #define SZ 48216 + 1024
15 int main()
17 int fd;
19 fd = shm_open("/hw_mngr.c", (O_CREAT | O_EXCL | O_RDWR),
20 (S_IREAD | S_IWRITE));
21 DO(shm_open());
23 void *ptr;
24 ftruncate(fd, SZ);
25 DO(ftruncate(fd, SZ));
27 ptr = mmap(0, SZ, (PROT_READ | PROT_WRITE), MAP_SHARED, fd, 0);
28 DO(mmap());
30 munmap(ptr, SZ);
31 DO(munmap());
33 shm_unlink("/hw_mngr.c");
34 DO(shm_unlink());
35 return 0;