All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrei Borzenkov <arvidjaar@gmail.com>
To: Felix Janda <felix.janda@posteo.de>
Cc: grub-devel@gnu.org
Subject: Re: [PATCH] On linux require the libc to have large file support
Date: Sun, 18 Jan 2015 20:53:20 +0300	[thread overview]
Message-ID: <20150118205320.14a5945f@opensuse.site> (raw)
In-Reply-To: <20150117135706.GA23804@euler>

В Sat, 17 Jan 2015 14:57:07 +0100
Felix Janda <felix.janda@posteo.de> пишет:

> 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

I wonder if we should do it unconditionally. Large files support is
really presumed by current code.

Not for now, but something to keep in mind for next version.

> +  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 <sys/ioctl.h>         /* ioctl */
>  # include <sys/mount.h>
> -# if !defined(__GLIBC__) || \
> -        ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1)))
> -/* Maybe libc doesn't have large file support.  */
> -#  include <linux/unistd.h>     /* _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.  */



  reply	other threads:[~2015-01-18 17:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-17 13:57 [PATCH] On linux require the libc to have large file support Felix Janda
2015-01-18 17:53 ` Andrei Borzenkov [this message]
2015-01-18 18:11   ` Felix Janda
2015-01-18 18:18     ` Felix Janda
2015-01-22 18:56       ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-01-25 18:49         ` Felix Janda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150118205320.14a5945f@opensuse.site \
    --to=arvidjaar@gmail.com \
    --cc=felix.janda@posteo.de \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.