From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1YCTtT-000380-R7 for mharc-grub-devel@gnu.org; Sat, 17 Jan 2015 08:58:27 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59099) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCTtP-00035O-Mv for grub-devel@gnu.org; Sat, 17 Jan 2015 08:58:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YCTtM-0003ht-FF for grub-devel@gnu.org; Sat, 17 Jan 2015 08:58:23 -0500 Received: from mx02.posteo.de ([89.146.194.165]:55982) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCTtM-0003hp-8k for grub-devel@gnu.org; Sat, 17 Jan 2015 08:58:20 -0500 Received: from dovecot03.posteo.de (unknown [185.67.36.28]) by mx02.posteo.de (Postfix) with ESMTPS id 41F5399E1F1 for ; Sat, 17 Jan 2015 14:58:17 +0100 (CET) Received: from mail.posteo.de (localhost [127.0.0.1]) by dovecot03.posteo.de (Postfix) with ESMTPSA id 3kPgp06rDHz5vMp for ; Sat, 17 Jan 2015 14:58:16 +0100 (CET) Date: Sat, 17 Jan 2015 14:57:07 +0100 From: Felix Janda To: grub-devel@gnu.org Subject: [PATCH] On linux require the libc to have large file support Message-ID: <20150117135706.GA23804@euler> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.22 (2013-10-16) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 89.146.194.165 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2015 13:58:24 -0000 With this, support code in grub-core/osdep/unix/hostdisk.c for old glibc releases could be removed. --- This patch tries to address the issues raised in http://lists.gnu.org/archive/html/grub-devel/2014-12/msg00030.html --- INSTALL | 1 + configure.ac | 5 +++++ grub-core/osdep/unix/hostdisk.c | 25 ------------------------- 3 files changed, 6 insertions(+), 25 deletions(-) diff --git a/INSTALL b/INSTALL index b67cd7f..ac7c2aa 100644 --- a/INSTALL +++ b/INSTALL @@ -39,6 +39,7 @@ configuring the GRUB. On GNU/Linux, you also need: * libdevmapper 1.02.34 or later (recommended) +* a libc with large file support (e.g. glibc 2.1 or later) For optional grub-emu features, you need: diff --git a/configure.ac b/configure.ac index 31d2b0b..bdaebb8 100644 --- a/configure.ac +++ b/configure.ac @@ -346,6 +346,11 @@ AC_GNU_SOURCE AM_GNU_GETTEXT([external]) AC_SYS_LARGEFILE +if test x"$host_kernel" = xlinux ; then + AC_CHECK_SIZEOF(off_t) + test x"$ac_cv_sizeof_off_t" = x8 || AC_MSG_ERROR([Large file support is required]) +fi + # Identify characteristics of the host architecture. unset ac_cv_c_bigendian diff --git a/grub-core/osdep/unix/hostdisk.c b/grub-core/osdep/unix/hostdisk.c index 43b56ff..14cab1c 100644 --- a/grub-core/osdep/unix/hostdisk.c +++ b/grub-core/osdep/unix/hostdisk.c @@ -48,11 +48,6 @@ #ifdef __linux__ # include /* ioctl */ # include -# if !defined(__GLIBC__) || \ - ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1))) -/* Maybe libc doesn't have large file support. */ -# include /* _llseek */ -# endif /* (GLIBC < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR < 1)) */ #endif /* __linux__ */ grub_uint64_t @@ -79,24 +74,6 @@ grub_util_get_fd_size (grub_util_fd_t fd, const char *name, unsigned *log_secsiz return st.st_size; } -#if defined(__linux__) && (!defined(__GLIBC__) || \ - ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1)))) - /* Maybe libc doesn't have large file support. */ -int -grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off) -{ - loff_t offset, result; - static int _llseek (uint filedes, ulong hi, ulong lo, - loff_t *res, uint wh); - _syscall5 (int, _llseek, uint, filedes, ulong, hi, ulong, lo, - loff_t *, res, uint, wh); - - offset = (loff_t) off; - if (_llseek (fd, offset >> 32, offset & 0xffffffff, &result, SEEK_SET)) - return -1; - return GRUB_ERR_NONE; -} -#else int grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off) { @@ -107,8 +84,6 @@ grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off) return 0; } -#endif - /* Read LEN bytes from FD in BUF. Return less than or equal to zero if an error occurs, otherwise return LEN. */ -- 2.0.5