Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
ioping
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ioping
Commits
b39c7630
Commit
b39c7630
authored
Jun 09, 2011
by
Konstantin Khlebnikov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use macos fcntl F_NOCACHE
parent
3485b25b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
ioping.c
ioping.c
+7
-0
No files found.
ioping.c
View file @
b39c7630
...
@@ -400,8 +400,10 @@ int main (int argc, char **argv)
...
@@ -400,8 +400,10 @@ int main (int argc, char **argv)
errx
(
1
,
"request size must be greather than zero"
);
errx
(
1
,
"request size must be greather than zero"
);
flags
=
O_RDONLY
;
flags
=
O_RDONLY
;
#ifdef O_DIRECT
if
(
direct
)
if
(
direct
)
flags
|=
O_DIRECT
;
flags
|=
O_DIRECT
;
#endif
if
(
stat
(
path
,
&
st
))
if
(
stat
(
path
,
&
st
))
err
(
2
,
"stat
\"
%s
\"
failed"
,
path
);
err
(
2
,
"stat
\"
%s
\"
failed"
,
path
);
...
@@ -470,6 +472,11 @@ int main (int argc, char **argv)
...
@@ -470,6 +472,11 @@ int main (int argc, char **argv)
err
(
2
,
"failed to open
\"
%s
\"
"
,
path
);
err
(
2
,
"failed to open
\"
%s
\"
"
,
path
);
}
}
#ifdef __APPLE__
if
(
fcntl
(
fd
,
F_NOCACHE
,
direct
))
err
(
2
,
"fcntl nocache failed"
);
#endif
if
(
!
cached
)
{
if
(
!
cached
)
{
ret
=
posix_fadvise
(
fd
,
offset
,
wsize
,
POSIX_FADV_RANDOM
);
ret
=
posix_fadvise
(
fd
,
offset
,
wsize
,
POSIX_FADV_RANDOM
);
if
(
ret
)
if
(
ret
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment