linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Khem Raj <raj.khem@gmail.com>
Cc: linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH 2/2] f2fs_io: Define _FILE_OFFSET_BITS=64
Date: Thu, 22 Dec 2022 16:14:38 -0800	[thread overview]
Message-ID: <Y6Ty7qaU2jOf/P1m@google.com> (raw)
In-Reply-To: <20221222022830.976309-2-raj.khem@gmail.com>

On 12/21, Khem Raj wrote:
> Remove _LARGEFILE64_SOURCE, this is redundant when _FILE_OFFSET_BITS=64
> additionally it fixes build with musl because the detection logic for
> lseek64 fails because when using _LARGEFILE64_SOURCE musl also define's
> lseek64 as an alias to lseek
> 
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  lib/libf2fs_io.c        | 4 +++-
>  tools/f2fs_io/f2fs_io.c | 4 ++--
>  2 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/libf2fs_io.c b/lib/libf2fs_io.c
> index 1a8167d..abb43a3 100644
> --- a/lib/libf2fs_io.c
> +++ b/lib/libf2fs_io.c
> @@ -11,7 +11,9 @@
>   *
>   * Dual licensed under the GPL or LGPL version 2 licenses.
>   */
> -#define _LARGEFILE64_SOURCE
> +#ifndef _FILE_OFFSET_BITS
> +#define _FILE_OFFSET_BITS 64
> +#endif

This fails to build in x86_64/gcc.

libf2fs_io.c:87:8: error: unknown type name 'off64_t'
   87 | static off64_t  *dcache_blk; /* which block it cached */
      |        ^~~~~~~


>  
>  #include <stdio.h>
>  #include <stdlib.h>
> diff --git a/tools/f2fs_io/f2fs_io.c b/tools/f2fs_io/f2fs_io.c
> index 6dcd840..cb99039 100644
> --- a/tools/f2fs_io/f2fs_io.c
> +++ b/tools/f2fs_io/f2fs_io.c
> @@ -12,8 +12,8 @@
>  #ifndef _LARGEFILE_SOURCE
>  #define _LARGEFILE_SOURCE
>  #endif
> -#ifndef _LARGEFILE64_SOURCE
> -#define _LARGEFILE64_SOURCE
> +#ifndef _FILE_OFFSET_BITS
> +#define _FILE_OFFSET_BITS 64
>  #endif
>  #ifndef O_LARGEFILE
>  #define O_LARGEFILE 0
> -- 
> 2.39.0
> 
> 
> 
> _______________________________________________
> Linux-f2fs-devel mailing list
> Linux-f2fs-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

      reply	other threads:[~2022-12-23  0:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-22  2:28 [f2fs-dev] [PATCH 1/2] f2fs_io: Fix out of tree builds Khem Raj
2022-12-22  2:28 ` [f2fs-dev] [PATCH 2/2] f2fs_io: Define _FILE_OFFSET_BITS=64 Khem Raj
2022-12-23  0:14   ` Jaegeuk Kim [this message]

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=Y6Ty7qaU2jOf/P1m@google.com \
    --to=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=raj.khem@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).