Pass O_LARGEFILE to open() in case we want to link on something that
authorhpa <hpa>
Wed, 16 Apr 2003 03:20:25 +0000 (03:20 +0000)
committerhpa <hpa>
Wed, 16 Apr 2003 03:20:25 +0000 (03:20 +0000)
doesn't have _FILE_OFFSET_BITS=64, like klibc.  We only touch the
first 512 bytes regardless, so it's completely harmless even if we
only get 32 bits.

syslinux-nomtools.c

index 9e83835..f2dba34 100644 (file)
@@ -20,8 +20,9 @@
  * mtools, but requires root privilege.
  */
 
-#define _XOPEN_SOURCE 500      /* Required on glibc 2.x */
-#define _BSD_SOURCE
+#define _XOPEN_SOURCE 500      /* For pread() pwrite() */
+#define _BSD_SOURCE            /* For seteuid() */
+#define _LARGEFILE64_SOURCE    /* For O_LARGEFILE */
 #include <alloca.h>
 #include <errno.h>
 #include <fcntl.h>
@@ -230,7 +231,7 @@ int main(int argc, char *argv[])
    * First make sure we can open the device at all, and that we have
    * read/write permission.
    */
-  dev_fd = open(device, O_RDWR);
+  dev_fd = open(device, O_RDWR|O_LARGEFILE);
   if ( dev_fd < 0 || fstat(dev_fd, &st) < 0 ) {
     perror(device);
     exit(1);