Re: [PATCH] lomount: Use O_LARGEFILE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alexey Gladkov wrote:

Use O_LARGEFILE in lomount if this possible.

Signed-off-by: Alexey Gladkov <legion@xxxxxxxxxxxx>
---
mount/lomount.c |    3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/mount/lomount.c b/mount/lomount.c
index c3ac68a..f12661f 100644
--- a/mount/lomount.c
+++ b/mount/lomount.c
@@ -626,6 +626,9 @@ set_loop(const char *device, const char *file, unsigned long long offset,
       }

       mode = (*options & SETLOOP_RDONLY) ? O_RDONLY : O_RDWR;
+#ifdef O_LARGEFILE
+       mode |= O_LARGEFILE;
+#endif
       if ((ffd = open(file, mode)) < 0) {
               if (!(*options & SETLOOP_RDONLY) && errno == EROFS)
                       ffd = open(file, mode = O_RDONLY);
The standard way of doing this is to run the AC_SYS_LARGEFILE macro from configure. This makes sure that everything that is necessary for accessing large files is part of config.h (you must also make sure that config.h is included before the system headers are included, of course). This also makes sure that off_t is wide if necessary, and other required stuff.

Shachar
--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux