From: Li Wang <liwang@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] tst_device: use raw syscall in the tst_device.h
Date: Thu, 9 Jan 2020 15:15:10 +0800 [thread overview]
Message-ID: <20200109071510.11223-1-liwang@redhat.com> (raw)
To follow up commit 447c223dba538efc7be23edc.
Signed-off-by: Li Wang <liwang@redhat.com>
Tested-by: Li Wang <liwang@redhat.com>
Cc: Petr Vorel <pvorel@suse.cz>
Cc: Cyril Hrubis <chrubis@suse.cz>
---
include/tst_device.h | 6 ++++--
testcases/kernel/syscalls/fadvise/posix_fadvise01.c | 1 +
testcases/kernel/syscalls/fadvise/posix_fadvise02.c | 1 +
testcases/kernel/syscalls/fadvise/posix_fadvise03.c | 1 +
testcases/kernel/syscalls/fadvise/posix_fadvise04.c | 1 +
testcases/kernel/syscalls/fstat/fstat03.c | 1 +
testcases/kernel/syscalls/pwrite/pwrite02.c | 1 +
7 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/include/tst_device.h b/include/tst_device.h
index f277afd77..b4067be52 100644
--- a/include/tst_device.h
+++ b/include/tst_device.h
@@ -18,7 +18,9 @@
#ifndef TST_DEVICE_H__
#define TST_DEVICE_H__
+#define _GNU_SOURCE
#include <unistd.h>
+#include <sys/syscall.h>
struct tst_device {
const char *dev;
@@ -75,9 +77,9 @@ int tst_detach_device(const char *dev_path);
* simply before the tst_dev_bytes_written invocation. For easy to use,
* we create this inline function tst_dev_sync.
*/
-static inline void tst_dev_sync(int fd)
+static inline int tst_dev_sync(int fd)
{
- syncfs(fd);
+ return syscall(__NR_syncfs, fd);
}
/*
diff --git a/testcases/kernel/syscalls/fadvise/posix_fadvise01.c b/testcases/kernel/syscalls/fadvise/posix_fadvise01.c
index 2af040840..f5d7ca8ac 100644
--- a/testcases/kernel/syscalls/fadvise/posix_fadvise01.c
+++ b/testcases/kernel/syscalls/fadvise/posix_fadvise01.c
@@ -20,6 +20,7 @@
* None
*/
+#define _GNU_SOURCE
#define _XOPEN_SOURCE 600
#include <fcntl.h>
diff --git a/testcases/kernel/syscalls/fadvise/posix_fadvise02.c b/testcases/kernel/syscalls/fadvise/posix_fadvise02.c
index d533a7953..899f58af8 100644
--- a/testcases/kernel/syscalls/fadvise/posix_fadvise02.c
+++ b/testcases/kernel/syscalls/fadvise/posix_fadvise02.c
@@ -20,6 +20,7 @@
* None
*/
+#define _GNU_SOURCE
#define _XOPEN_SOURCE 600
#include <fcntl.h>
#include <unistd.h>
diff --git a/testcases/kernel/syscalls/fadvise/posix_fadvise03.c b/testcases/kernel/syscalls/fadvise/posix_fadvise03.c
index 5bada5f3d..efd3ab378 100644
--- a/testcases/kernel/syscalls/fadvise/posix_fadvise03.c
+++ b/testcases/kernel/syscalls/fadvise/posix_fadvise03.c
@@ -20,6 +20,7 @@
* None
*/
+#define _GNU_SOURCE
#define _XOPEN_SOURCE 600
#include <fcntl.h>
#include <unistd.h>
diff --git a/testcases/kernel/syscalls/fadvise/posix_fadvise04.c b/testcases/kernel/syscalls/fadvise/posix_fadvise04.c
index d8d8fb601..58162c6fb 100644
--- a/testcases/kernel/syscalls/fadvise/posix_fadvise04.c
+++ b/testcases/kernel/syscalls/fadvise/posix_fadvise04.c
@@ -20,6 +20,7 @@
* None
*/
+#define _GNU_SOURCE
#define _XOPEN_SOURCE 600
#include <fcntl.h>
#include <unistd.h>
diff --git a/testcases/kernel/syscalls/fstat/fstat03.c b/testcases/kernel/syscalls/fstat/fstat03.c
index 68fae43df..51637cdd7 100644
--- a/testcases/kernel/syscalls/fstat/fstat03.c
+++ b/testcases/kernel/syscalls/fstat/fstat03.c
@@ -13,6 +13,7 @@
* -> EFAULT (or receive signal SIGSEGV)
*/
+#define _GNU_SOURCE
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/testcases/kernel/syscalls/pwrite/pwrite02.c b/testcases/kernel/syscalls/pwrite/pwrite02.c
index 056d44da2..4582d4e94 100644
--- a/testcases/kernel/syscalls/pwrite/pwrite02.c
+++ b/testcases/kernel/syscalls/pwrite/pwrite02.c
@@ -18,6 +18,7 @@
* accessible address space, returns EFAULT.
*/
+#define _GNU_SOURCE
#define _XOPEN_SOURCE 500
#include <errno.h>
--
2.20.1
next reply other threads:[~2020-01-09 7:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-09 7:15 Li Wang [this message]
2020-01-09 7:45 ` [LTP] [PATCH] tst_device: use raw syscall in the tst_device.h 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
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=20200109071510.11223-1-liwang@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox