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
44aac25f
Commit
44aac25f
authored
Jun 09, 2011
by
Konstantin Khlebnikov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stubs for posix_memalign() and posix_fadvice()
parent
9bce164c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
ioping.c
ioping.c
+33
-0
No files found.
ioping.c
View file @
44aac25f
...
@@ -37,6 +37,39 @@
...
@@ -37,6 +37,39 @@
#include <sys/mount.h>
#include <sys/mount.h>
#include <sys/ioctl.h>
#include <sys/ioctl.h>
#ifdef __linux__
# define HAVE_POSIX_FADVICE
# define HAVE_POSIX_MEMALLIGN
#endif
#ifndef HAVE_POSIX_FADVICE
# define POSIX_FADV_RANDOM 0
# define POSIX_FADV_DONTNEED 0
int
posix_fadvise
(
int
fd
,
off_t
offset
,
off_t
len
,
int
advice
)
{
(
void
)
fd
;
(
void
)
offset
;
(
void
)
len
;
(
void
)
advice
;
errno
=
ENOSYS
;
return
-
1
;
}
#endif
#ifndef HAVE_POSIX_MEMALLIGN
/* don't free it */
int
posix_memalign
(
void
**
memptr
,
size_t
alignment
,
size_t
size
)
{
char
*
ptr
;
ptr
=
malloc
(
size
+
alignment
);
if
(
!
ptr
)
return
-
ENOMEM
;
*
memptr
=
ptr
+
alignment
-
(
size_t
)
ptr
%
alignment
;
return
0
;
}
#endif
void
usage
(
void
)
void
usage
(
void
)
{
{
fprintf
(
stderr
,
fprintf
(
stderr
,
...
...
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