]> git.tdb.fi Git - libs/core.git/commitdiff
Use _FILE_OFFSET_BITS rather than _LARGEFILE64_SOURCE
authorMikko Rasa <tdb@tdb.fi>
Fri, 24 May 2013 14:38:32 +0000 (17:38 +0300)
committerMikko Rasa <tdb@tdb.fi>
Wed, 29 May 2013 08:43:21 +0000 (11:43 +0300)
lseek64 and off64_t are non-portable.  This makes the standard lseek use
a 64-bit interface.

source/io/unix/seekable.cpp

index 2c17114df3d617a1037e3ee6167cff051249fc88..93a6e86e1f8427635f5f7da38ac825e7c8fe3a3f 100644 (file)
@@ -1,4 +1,4 @@
-#define _LARGEFILE64_SOURCE
+#define _FILE_OFFSET_BITS 64
 #include <cerrno>
 #include <unistd.h>
 #include <msp/core/systemerror.h>
@@ -31,8 +31,8 @@ namespace IO {
 
 SeekOffset sys_seek(Handle &handle, SeekOffset offset, SeekType type)
 {
-       off64_t ret = lseek64(*handle, offset, sys_seek_type(type));
-       if(ret==(off64_t)-1)
+       off_t ret = lseek(*handle, offset, sys_seek_type(type));
+       if(ret==(off_t)-1)
        {
                if(errno==EINVAL)
                        throw bad_seek(offset, type);