All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Wang <liwang@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 4/7] syscalls/fsmount: New tests
Date: Mon, 17 Feb 2020 18:28:03 +0800	[thread overview]
Message-ID: <CAEemH2dZboTZX00t0Kt6n_-sV+9StvJ24-ZLpdU3xFegBuLncQ@mail.gmail.com> (raw)
In-Reply-To: <20200217095810.GC13398@dell5510>

On Mon, Feb 17, 2020 at 5:58 PM Petr Vorel <pvorel@suse.cz> wrote:

> Hi Li,
>
> > On Mon, Feb 17, 2020 at 4:29 PM Viresh Kumar <viresh.kumar@linaro.org>
> > wrote:
>
> > > ...
> > > > Adding #include "lapi/fcntl.h" in case of ?AT_FDCWD? undeclared. It
> seems
> > > > we have to do this for all the tests involves  ?AT_FDCWD?.
>
> > > my fsmount.h header includes <fcntl.h>, won't that be enough ?
>
>
> > I'm afraid it's not enough.
>
> > After having a closer look, the reason is that the AT_FDCWD is defined
> with
> > condition __USE_ATFILE,  the __USE_ATFILE depends on _ATFILE_SOURCE
> > defined, and _ATFILE_SOURCE needs enable _GNU_SOURCE.
>
> > So another effective way is to add '#define _GNU_SOURCE' in front of your
> > test then that <fcntl.h> will be work for you.
>
> OK, we can add #define _GNU_SOURCE to fsmount01.c, which actually needs it
> + keep <fcntl.h> there and load lapi/fsmount.h later (see below).
> But generally this will be the approach for all uses of <fcntl.h> (and
> probably
> some other headers) for old distros. IMHO this change is caused by:
>
> c941736c92 Remove _BSD_SOURCE and _SVID_SOURCE. (glibc-2.20)
> c688b41960 Add _DEFAULT_SOURCE feature test macro. (glibc-2.19)
>

Thanks for figure out this.

>
> So we can either add it to many places or detect this old glibc and
> compile with
> -D_GNU_SOURCE (but this might break other things).
>

-1 remove old Glibc is a bad choice.


> But that's another story.
>
> > # rpm -qa glibc-headers
> > glibc-headers-2.5-123
>
> > # cat /usr/include/fcntl.h |grep AT_FDCWD -B 2 -A 2
> > #ifdef __USE_ATFILE
> > # define AT_FDCWD -100   /* Special value used to indicate
> >                                                 the *at functions should
> > use the
> >                                                 current working
> directory.
> > */
>
> So is this diff to v7 better?
>

To use "lapi/fcntl.h" in v7 is simpler I guess, sometimes we just need to
get compile pass on old distros but not perform it indeed. And that's the
purpose why we need lapi/*.

-- 
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20200217/8ae9c1ca/attachment.htm>

  reply	other threads:[~2020-02-17 10:28 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-14 11:35 [LTP] [PATCH 0/7] Add new LTP tests related to fsmount family of syscalls Viresh Kumar
2020-02-14 11:35 ` [LTP] [PATCH 1/7] lapi/fsmount: Add definitions for fsmount related syscalls Viresh Kumar
2020-02-16  9:09   ` Li Wang
2020-02-17  8:08     ` Viresh Kumar
2020-02-14 11:35 ` [LTP] [PATCH 2/7] syscalls/fsopen: New tests Viresh Kumar
2020-02-16 10:11   ` Li Wang
2020-02-17  8:09     ` Viresh Kumar
2020-02-17 13:36     ` Cyril Hrubis
2020-02-18  1:15       ` Li Wang
2020-02-18  8:25         ` Viresh Kumar
2020-02-18  9:02           ` Li Wang
2020-02-18  9:08             ` Viresh Kumar
2020-02-19  8:23         ` Petr Vorel
2020-02-19  8:34           ` Viresh Kumar
2020-02-19  8:50         ` Petr Vorel
2020-02-19  8:51           ` Viresh Kumar
2020-02-14 11:35 ` [LTP] [PATCH 3/7] syscalls/fsconfig: " Viresh Kumar
2020-02-14 11:35 ` [LTP] [PATCH 4/7] syscalls/fsmount: " Viresh Kumar
2020-02-17  8:17   ` Li Wang
2020-02-17  8:29     ` Viresh Kumar
2020-02-17  8:54       ` Li Wang
2020-02-17  9:58         ` Petr Vorel
2020-02-17 10:28           ` Li Wang [this message]
2020-02-17 10:37             ` Li Wang
2020-02-17 11:02               ` Petr Vorel
2020-02-17  8:58       ` Petr Vorel
2020-02-14 11:35 ` [LTP] [PATCH 5/7] syscalls/move_mount: " Viresh Kumar
2020-02-14 11:35 ` [LTP] [PATCH 6/7] syscalls/fspick: " Viresh Kumar
2020-02-14 11:35 ` [LTP] [PATCH 7/7] syscalls/open_tree: " Viresh Kumar
2020-02-18  6:19 ` [LTP] [PATCH 0/7] Add new LTP tests related to fsmount family of syscalls Zorro Lang
2020-02-18  6:50   ` Li Wang
2020-02-18  6:58   ` Viresh Kumar

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=CAEemH2dZboTZX00t0Kt6n_-sV+9StvJ24-ZLpdU3xFegBuLncQ@mail.gmail.com \
    --to=liwang@redhat.com \
    --cc=ltp@lists.linux.it \
    /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.