Address unused-parameter warning on Macs

Function posix_fadvise(), only implemented on Macs, was issuing
warnings because the code doesn't use parameters 'offset' and 'len'.
This commit is contained in:
Michel Machado 2014-12-16 07:10:02 -05:00
parent e8509a05e9
commit f8050f4721
2 changed files with 4 additions and 0 deletions

View File

@ -238,6 +238,8 @@ static inline int fdatasync(int fd)
/* This function is a _rough_ approximation of posix_fadvise(2). */
int posix_fadvise(int fd, off_t offset, off_t len, int advice)
{
UNUSED(offset);
UNUSED(len);
switch (advice) {
case POSIX_FADV_SEQUENTIAL:
return fcntl(fd, F_RDAHEAD, 1);

View File

@ -34,6 +34,8 @@ static inline uint64_t random_number(uint64_t prv_number)
return prv_number * 4294967311ULL + 17;
}
#define UNUSED(x) ((void)x)
#if __APPLE__ && __MACH__
#include <unistd.h> /* For type off_t. */