#include "lauxlib.h"
#include <fcntl.h>
-#if defined(_GNU_SOURCE)
+#if defined(__linux__) && defined(_GNU_SOURCE)
#include <linux/falloc.h>
#endif
return -1;
}
-int arg_to_rlimit(lua_State* L, int idx, rlim_t current) {
+unsigned long int arg_to_rlimit(lua_State* L, int idx, rlim_t current) {
switch(lua_type(L, idx)) {
case LUA_TSTRING:
if(strcmp(lua_tostring(L, idx), "unlimited") == 0)
offset = luaL_checkinteger(L, 2);
len = luaL_checkinteger(L, 3);
-#if defined(_GNU_SOURCE)
+#if defined(__linux__) && defined(_GNU_SOURCE)
if(fallocate(fileno(f), FALLOC_FL_KEEP_SIZE, offset, len) == 0)
{
lua_pushboolean(L, 1);