diff options
| author | mascarenhas <mascarenhas> | 2008-03-25 18:20:29 +0000 |
|---|---|---|
| committer | mascarenhas <mascarenhas> | 2008-03-25 18:20:29 +0000 |
| commit | baf658a7218e0ec6f400b461819a21f81dcdd518 (patch) | |
| tree | e01b21bf048f95e7c0e5acf4e2f827e849f108aa /src | |
| parent | 5c8e92efa35f241d346dd839658c7d52bd699c8e (diff) | |
| download | luafilesystem-baf658a7218e0ec6f400b461819a21f81dcdd518.tar.gz luafilesystem-baf658a7218e0ec6f400b461819a21f81dcdd518.tar.bz2 luafilesystem-baf658a7218e0ec6f400b461819a21f81dcdd518.zip | |
large file support in Linux needs STAT64=-DHAVE_STAT64 in LuaRocks
config
Diffstat (limited to 'src')
| -rw-r--r-- | src/lfs.c | 11 |
1 files changed, 9 insertions, 2 deletions
| @@ -16,7 +16,7 @@ | |||
| 16 | ** lfs.touch (filepath [, atime [, mtime]]) | 16 | ** lfs.touch (filepath [, atime [, mtime]]) |
| 17 | ** lfs.unlock (fh) | 17 | ** lfs.unlock (fh) |
| 18 | ** | 18 | ** |
| 19 | ** $Id: lfs.c,v 1.50 2008/03/25 16:58:29 mascarenhas Exp $ | 19 | ** $Id: lfs.c,v 1.51 2008/03/25 18:20:29 mascarenhas Exp $ |
| 20 | */ | 20 | */ |
| 21 | 21 | ||
| 22 | #define _LARGEFILE64_SOURCE | 22 | #define _LARGEFILE64_SOURCE |
| @@ -82,8 +82,15 @@ typedef struct dir_data { | |||
| 82 | #define _O_BINARY 0 | 82 | #define _O_BINARY 0 |
| 83 | #define lfs_setmode(L,file,m) ((void)((void)file,m), \ | 83 | #define lfs_setmode(L,file,m) ((void)((void)file,m), \ |
| 84 | luaL_error(L, LUA_QL("setmode") " not supported on this platform"), -1) | 84 | luaL_error(L, LUA_QL("setmode") " not supported on this platform"), -1) |
| 85 | #ifdef HAVE_STAT64 | ||
| 85 | #define STAT_STRUCT struct stat64 | 86 | #define STAT_STRUCT struct stat64 |
| 86 | #define STAT_FUNC stat64 | 87 | #define STAT_FUNC stat64 |
| 88 | #define LSTAT_FUNC lstat64 | ||
| 89 | #else | ||
| 90 | #define STAT_STRUCT struct stat | ||
| 91 | #define STAT_FUNC stat | ||
| 92 | #define LSTAT_FUNC lstat | ||
| 93 | #endif | ||
| 87 | #endif | 94 | #endif |
| 88 | 95 | ||
| 89 | /* | 96 | /* |
| @@ -627,7 +634,7 @@ static int file_info (lua_State *L) { | |||
| 627 | */ | 634 | */ |
| 628 | #ifndef _WIN32 | 635 | #ifndef _WIN32 |
| 629 | static int link_info (lua_State *L) { | 636 | static int link_info (lua_State *L) { |
| 630 | return _file_info_ (L, lstat64); | 637 | return _file_info_ (L, LSTAT_FUNC); |
| 631 | } | 638 | } |
| 632 | #else | 639 | #else |
| 633 | static int link_info (lua_State *L) { | 640 | static int link_info (lua_State *L) { |
