[osx] sys_posix_fadvise()->fadvise().

This commit is contained in:
Lorenzo Cogotti 2022-12-12 15:58:36 +01:00
parent 1cc6bb3a90
commit 0e3125e59c
1 changed files with 3 additions and 3 deletions

6
osx.c
View File

@ -177,7 +177,7 @@ fail:
#endif #endif
#ifdef __linux__ #ifdef __linux__
#define sys_posix_fadvise(fd, advice) posix_fadvise(fd, 0, 0, advice) #define fadvise(fd, advice) posix_fadvise(fd, 0, 0, advice)
#else #else
// Stub posix_fadvise() // Stub posix_fadvise()
#define POSIX_FADV_NORMAL 0 #define POSIX_FADV_NORMAL 0
@ -185,7 +185,7 @@ fail:
#define POSIX_FADV_RANDOM 0 #define POSIX_FADV_RANDOM 0
#define POSIX_FADV_NOREUSE 0 #define POSIX_FADV_NOREUSE 0
static inline int sys_posix_fadvise(int fd, int advice) static inline int fadvise(int fd, int advice)
{ {
(void) fd; (void) fd;
(void) advice; (void) advice;
@ -645,7 +645,7 @@ static int os_fadvise(lua_State *L)
luaL_Stream *stream = luaL_checkudata(L, 1, LUA_FILEHANDLE); luaL_Stream *stream = luaL_checkudata(L, 1, LUA_FILEHANDLE);
int i = luaL_checkoption(L, 2, NULL, hints); int i = luaL_checkoption(L, 2, NULL, hints);
int ec = sys_posix_fadvise(fileno(stream->f), ihints[i]); int ec = fadvise(fileno(stream->f), ihints[i]);
return os_result(L, ec, NULL); return os_result(L, ec, NULL);
} }