public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] tst_device: use raw syscall in the tst_device.h
Date: Thu, 9 Jan 2020 15:28:02 +0100	[thread overview]
Message-ID: <20200109142802.GA15780@dell5510> (raw)
In-Reply-To: <20200109131056.GC22952@rei.lan>

Hi,

> > > But shouldn't we define the _GNU_SOURCE for syscall()?  Otherwise,
> > > the _XOPEN_SOURCE 600 definitions will take effect and makes the compiler
> > > print new errors[1].
> > Correct, syscall() requires _GNU_SOURCE and <unistd.h>.

> Not really, it's guarded by _USE_MISC which is enabled by default and
> disabled by _XOPEN_SOURCE.
Yep, looking into features.h __USE_MISC is defined by _DEFAULT_SOURCE,
which is enabled if nothing or only _GNU_SOURCE is defined.

> Looks like the manual page is outdated at least.
Yes, that's what I checked this time (I usually look into sources).

> > + Not sure if <sys/syscall.h> should be used (as it's in your patch or
> > lapi/syscalls.h.

> Well, given that syncfs is old enough (2.6.39) either should work.

> > > Here I feel a little confused, or do we need to delete the _XOPEN_SOURCE
> > > definition directly for the test posix_fadvise01.c?

> > > [1]:
> > > gcc -Werror=implicit-function-declaration -g -O2 -fno-strict-aliasing -pipe
> > > -Wall -W -Wold-style-definition
> > >  -I/root/ltp2/testcases/kernel/syscalls/fadvise
> > > -I/root/ltp2/testcases/kernel/syscalls/fadvise/../utils
> > > -I../../../../include -I../../../../include -I../../../../include/old/
> > > -L../../../../lib  posix_fadvise01.c   -lltp -o posix_fadvise01
> > > In file included from ../../../../include/tst_test.h:22,
> > >                  from posix_fadvise01.c:31:
> > > ../../../../include/tst_device.h: In function ???tst_dev_sync???:
> > > ../../../../include/tst_device.h:82:9: error: implicit declaration of
> > > function ???syscall???; did you mean ???strcoll????
> > > [-Werror=implicit-function-declaration]
> > >   return syscall(__NR_syncfs, fd);
> > >          ^~~~~~~
> > >          strcoll

> > + Our syscall numbers in include/lapi/syscalls/ are outdated (syncfs is not at
> > least in include/lapi/syscalls/sparc{64,}.in and
> > include/lapi/syscalls/x86_64.in).

> The lapi/syscall.h includes sys/syscall.h so it's probably not a
> problem, since there are no distribution that are missing syncfs in the
> system headers. Note that we are only adding fallback definitions there
> and if present the system values take precedence.
Good. Sorry for wrong report (haven't notice <sys/syscall.h> inclusion).

Kind regards,
Petr

      reply	other threads:[~2020-01-09 14:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-09  7:15 [LTP] [PATCH] tst_device: use raw syscall in the tst_device.h Li Wang
2020-01-09  7:45 ` Petr Vorel
2020-01-09  8:02   ` Li Wang
2020-01-09  8:21     ` Petr Vorel
2020-01-09  9:52 ` Cyril Hrubis
2020-01-09  9:59   ` Petr Vorel
2020-01-09 12:41   ` Li Wang
2020-01-09 12:49     ` Cyril Hrubis
2020-01-09 12:56       ` Li Wang
2020-01-09 12:56     ` Petr Vorel
2020-01-09 13:10       ` Cyril Hrubis
2020-01-09 14:28         ` Petr Vorel [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=20200109142802.GA15780@dell5510 \
    --to=pvorel@suse.cz \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox