repo.or.cz
/
valgrind.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
FreeBSD: add file descriptor tracking for _umtx_op
[valgrind.git]
/
none
/
tests
/
mmap_o_direct.c
blob
9a877f91789ab3b6996c944b4cfffd09139b2268
1
#include <unistd.h>
2
#define __USE_GNU
3
#include <fcntl.h>
4
#include <sys/mman.h>
5
#include <stddef.h>
6
#if !defined(O_DIRECT)
7
#define O_DIRECT 0
8
#endif
9
10
int
main
(
void
)
11
{
12
int
fd
=
open
(
"mmap_o_direct.c"
,
O_RDONLY
|
O_DIRECT
);
13
if
(-
1
!=
fd
)
14
{
15
void
*
m
=
mmap
(
NULL
,
307
,
PROT_READ
,
MAP_PRIVATE
,
fd
,
0
);
16
munmap
(
m
,
307
);
17
close
(
fd
);
18
}
19
}