|
|
2601b6 |
commit 7c91105917f41c11a0b377b2393725da380cd490
|
|
|
2601b6 |
Author: tom <tom@a5019735-40e9-0310-863c-91ae7b9d1cf9>
|
|
|
2601b6 |
Date: Thu May 7 18:54:31 2015 +0000
|
|
|
2601b6 |
|
|
|
2601b6 |
Add support for the syncfs system call.
|
|
|
2601b6 |
|
|
|
2601b6 |
Based on patch from j@eckel.me on BZ#347389.
|
|
|
2601b6 |
|
|
|
2601b6 |
|
|
|
2601b6 |
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15191 a5019735-40e9-0310-863c-91ae7b9d1cf9
|
|
|
2601b6 |
|
|
|
2601b6 |
diff --git a/coregrind/m_syswrap/priv_syswrap-linux.h b/coregrind/m_syswrap/priv_syswrap-linux.h
|
|
|
2601b6 |
index d093974..6552dca 100644
|
|
|
2601b6 |
--- a/coregrind/m_syswrap/priv_syswrap-linux.h
|
|
|
2601b6 |
+++ b/coregrind/m_syswrap/priv_syswrap-linux.h
|
|
|
2601b6 |
@@ -287,6 +287,8 @@ DECL_TEMPLATE(linux, sys_fanotify_mark);
|
|
|
2601b6 |
DECL_TEMPLATE(linux, sys_getrandom);
|
|
|
2601b6 |
DECL_TEMPLATE(linux, sys_memfd_create);
|
|
|
2601b6 |
|
|
|
2601b6 |
+DECL_TEMPLATE(linux, sys_syncfs);
|
|
|
2601b6 |
+
|
|
|
2601b6 |
/* ---------------------------------------------------------------------
|
|
|
2601b6 |
Wrappers for sockets and ipc-ery. These are split into standalone
|
|
|
2601b6 |
procedures because x86-linux hides them inside multiplexors
|
|
|
2601b6 |
diff --git a/coregrind/m_syswrap/syswrap-amd64-linux.c b/coregrind/m_syswrap/syswrap-amd64-linux.c
|
|
|
2601b6 |
index 62f7ee6..de3288e 100644
|
|
|
2601b6 |
--- a/coregrind/m_syswrap/syswrap-amd64-linux.c
|
|
|
2601b6 |
+++ b/coregrind/m_syswrap/syswrap-amd64-linux.c
|
|
|
2601b6 |
@@ -1062,7 +1062,7 @@ static SyscallTableEntry syscall_table[] = {
|
|
|
2601b6 |
LINXY(__NR_open_by_handle_at, sys_open_by_handle_at),// 304
|
|
|
2601b6 |
|
|
|
2601b6 |
LINXY(__NR_clock_adjtime, sys_clock_adjtime), // 305
|
|
|
2601b6 |
-// LINX_(__NR_syncfs, sys_ni_syscall), // 306
|
|
|
2601b6 |
+ LINX_(__NR_syncfs, sys_syncfs), // 306
|
|
|
2601b6 |
LINXY(__NR_sendmmsg, sys_sendmmsg), // 307
|
|
|
2601b6 |
// LINX_(__NR_setns, sys_ni_syscall), // 308
|
|
|
2601b6 |
LINXY(__NR_getcpu, sys_getcpu), // 309
|
|
|
2601b6 |
diff --git a/coregrind/m_syswrap/syswrap-arm-linux.c b/coregrind/m_syswrap/syswrap-arm-linux.c
|
|
|
2601b6 |
index dc8714c..f8f56f5 100644
|
|
|
2601b6 |
--- a/coregrind/m_syswrap/syswrap-arm-linux.c
|
|
|
2601b6 |
+++ b/coregrind/m_syswrap/syswrap-arm-linux.c
|
|
|
2601b6 |
@@ -1212,6 +1212,7 @@ static SyscallTableEntry syscall_main_table[] = {
|
|
|
2601b6 |
LINXY(__NR_name_to_handle_at, sys_name_to_handle_at),// 370
|
|
|
2601b6 |
LINXY(__NR_open_by_handle_at, sys_open_by_handle_at),// 371
|
|
|
2601b6 |
LINXY(__NR_clock_adjtime, sys_clock_adjtime), // 372
|
|
|
2601b6 |
+ LINX_(__NR_syncfs, sys_syncfs), // 373
|
|
|
2601b6 |
LINXY(__NR_sendmmsg, sys_sendmmsg), // 374
|
|
|
2601b6 |
LINXY(__NR_getrandom, sys_getrandom), // 384
|
|
|
2601b6 |
LINXY(__NR_memfd_create, sys_memfd_create) // 385
|
|
|
2601b6 |
diff --git a/coregrind/m_syswrap/syswrap-arm64-linux.c b/coregrind/m_syswrap/syswrap-arm64-linux.c
|
|
|
2601b6 |
index 2f35e51..7551e8a 100644
|
|
|
2601b6 |
--- a/coregrind/m_syswrap/syswrap-arm64-linux.c
|
|
|
2601b6 |
+++ b/coregrind/m_syswrap/syswrap-arm64-linux.c
|
|
|
2601b6 |
@@ -1042,6 +1042,8 @@ static SyscallTableEntry syscall_main_table[] = {
|
|
|
2601b6 |
|
|
|
2601b6 |
GENXY(__NR_wait4, sys_wait4), // 260
|
|
|
2601b6 |
|
|
|
2601b6 |
+ LINX_(__NR_syncfs, sys_syncfs), // 267
|
|
|
2601b6 |
+
|
|
|
2601b6 |
LINXY(__NR_sendmmsg, sys_sendmmsg), // 269
|
|
|
2601b6 |
LINXY(__NR_process_vm_readv, sys_process_vm_readv), // 270
|
|
|
2601b6 |
LINX_(__NR_process_vm_writev, sys_process_vm_writev), // 271
|
|
|
2601b6 |
diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c
|
|
|
2601b6 |
index f15c909..09c247c 100644
|
|
|
2601b6 |
--- a/coregrind/m_syswrap/syswrap-linux.c
|
|
|
2601b6 |
+++ b/coregrind/m_syswrap/syswrap-linux.c
|
|
|
2601b6 |
@@ -3064,6 +3064,13 @@ POST(sys_memfd_create)
|
|
|
2601b6 |
}
|
|
|
2601b6 |
}
|
|
|
2601b6 |
|
|
|
2601b6 |
+PRE(sys_syncfs)
|
|
|
2601b6 |
+{
|
|
|
2601b6 |
+ *flags |= SfMayBlock;
|
|
|
2601b6 |
+ PRINT("sys_syncfs ( %ld )", ARG1);
|
|
|
2601b6 |
+ PRE_REG_READ1(long, "syncfs", unsigned int, fd);
|
|
|
2601b6 |
+}
|
|
|
2601b6 |
+
|
|
|
2601b6 |
/* ---------------------------------------------------------------------
|
|
|
2601b6 |
utime wrapper
|
|
|
2601b6 |
------------------------------------------------------------------ */
|
|
|
2601b6 |
diff --git a/coregrind/m_syswrap/syswrap-mips32-linux.c b/coregrind/m_syswrap/syswrap-mips32-linux.c
|
|
|
2601b6 |
index 1b4c5bc..7a71576 100644
|
|
|
2601b6 |
--- a/coregrind/m_syswrap/syswrap-mips32-linux.c
|
|
|
2601b6 |
+++ b/coregrind/m_syswrap/syswrap-mips32-linux.c
|
|
|
2601b6 |
@@ -1112,6 +1112,7 @@ static SyscallTableEntry syscall_main_table[] = {
|
|
|
2601b6 |
LINXY (__NR_prlimit64, sys_prlimit64), // 338
|
|
|
2601b6 |
//..
|
|
|
2601b6 |
LINXY (__NR_clock_adjtime, sys_clock_adjtime), // 341
|
|
|
2601b6 |
+ LINX_ (__NR_syncfs, sys_syncfs), // 342
|
|
|
2601b6 |
//..
|
|
|
2601b6 |
LINXY (__NR_process_vm_readv, sys_process_vm_readv), // 345
|
|
|
2601b6 |
LINX_ (__NR_process_vm_writev, sys_process_vm_writev), // 346
|
|
|
2601b6 |
diff --git a/coregrind/m_syswrap/syswrap-mips64-linux.c b/coregrind/m_syswrap/syswrap-mips64-linux.c
|
|
|
2601b6 |
index d356645..3a5e979 100644
|
|
|
2601b6 |
--- a/coregrind/m_syswrap/syswrap-mips64-linux.c
|
|
|
2601b6 |
+++ b/coregrind/m_syswrap/syswrap-mips64-linux.c
|
|
|
2601b6 |
@@ -909,7 +909,8 @@ static SyscallTableEntry syscall_main_table[] = {
|
|
|
2601b6 |
LINXY (__NR_process_vm_readv, sys_process_vm_readv),
|
|
|
2601b6 |
LINX_ (__NR_process_vm_writev, sys_process_vm_writev),
|
|
|
2601b6 |
LINXY(__NR_getrandom, sys_getrandom),
|
|
|
2601b6 |
- LINXY(__NR_memfd_create, sys_memfd_create)
|
|
|
2601b6 |
+ LINXY(__NR_memfd_create, sys_memfd_create),
|
|
|
2601b6 |
+ LINX_(__NR_syncfs, sys_syncfs)
|
|
|
2601b6 |
};
|
|
|
2601b6 |
|
|
|
2601b6 |
SyscallTableEntry * ML_(get_linux_syscall_entry) ( UInt sysno )
|
|
|
2601b6 |
diff --git a/coregrind/m_syswrap/syswrap-ppc32-linux.c b/coregrind/m_syswrap/syswrap-ppc32-linux.c
|
|
|
2601b6 |
index 1f5d7f6..9c9937b 100644
|
|
|
2601b6 |
--- a/coregrind/m_syswrap/syswrap-ppc32-linux.c
|
|
|
2601b6 |
+++ b/coregrind/m_syswrap/syswrap-ppc32-linux.c
|
|
|
2601b6 |
@@ -1253,7 +1253,7 @@ static SyscallTableEntry syscall_table[] = {
|
|
|
2601b6 |
LINXY(__NR_accept4, sys_accept4), // 344
|
|
|
2601b6 |
|
|
|
2601b6 |
LINX_(__NR_clock_adjtime, sys_clock_adjtime), // 347
|
|
|
2601b6 |
-
|
|
|
2601b6 |
+ LINX_(__NR_syncfs, sys_syncfs), // 348
|
|
|
2601b6 |
LINXY(__NR_sendmmsg, sys_sendmmsg), // 349
|
|
|
2601b6 |
|
|
|
2601b6 |
LINXY(__NR_process_vm_readv, sys_process_vm_readv), // 351
|
|
|
2601b6 |
diff --git a/coregrind/m_syswrap/syswrap-ppc64-linux.c b/coregrind/m_syswrap/syswrap-ppc64-linux.c
|
|
|
2601b6 |
index 6f3c1f7..e2432fd 100644
|
|
|
2601b6 |
--- a/coregrind/m_syswrap/syswrap-ppc64-linux.c
|
|
|
2601b6 |
+++ b/coregrind/m_syswrap/syswrap-ppc64-linux.c
|
|
|
2601b6 |
@@ -1155,7 +1155,7 @@ static SyscallTableEntry syscall_table[] = {
|
|
|
2601b6 |
LINXY(__NR_accept4, sys_accept4), // 344
|
|
|
2601b6 |
|
|
|
2601b6 |
LINXY(__NR_clock_adjtime, sys_clock_adjtime), // 347
|
|
|
2601b6 |
-
|
|
|
2601b6 |
+ LINX_(__NR_syncfs, sys_syncfs), // 348
|
|
|
2601b6 |
LINXY(__NR_sendmmsg, sys_sendmmsg), // 349
|
|
|
2601b6 |
|
|
|
2601b6 |
LINXY(__NR_process_vm_readv, sys_process_vm_readv), // 351
|
|
|
2601b6 |
diff --git a/coregrind/m_syswrap/syswrap-s390x-linux.c b/coregrind/m_syswrap/syswrap-s390x-linux.c
|
|
|
2601b6 |
index 8e0afa0..db374f4 100644
|
|
|
2601b6 |
--- a/coregrind/m_syswrap/syswrap-s390x-linux.c
|
|
|
2601b6 |
+++ b/coregrind/m_syswrap/syswrap-s390x-linux.c
|
|
|
2601b6 |
@@ -1035,7 +1035,7 @@ static SyscallTableEntry syscall_table[] = {
|
|
|
2601b6 |
LINXY(__NR_name_to_handle_at, sys_name_to_handle_at), // 335
|
|
|
2601b6 |
LINXY(__NR_open_by_handle_at, sys_open_by_handle_at), // 336
|
|
|
2601b6 |
LINXY(__NR_clock_adjtime, sys_clock_adjtime), // 337
|
|
|
2601b6 |
-// ?????(__NR_syncfs, ), // 338
|
|
|
2601b6 |
+ LINX_(__NR_syncfs, sys_syncfs), // 338
|
|
|
2601b6 |
// ?????(__NR_setns, ), // 339
|
|
|
2601b6 |
|
|
|
2601b6 |
LINXY(__NR_process_vm_readv, sys_process_vm_readv), // 340
|
|
|
2601b6 |
diff --git a/coregrind/m_syswrap/syswrap-x86-linux.c b/coregrind/m_syswrap/syswrap-x86-linux.c
|
|
|
2601b6 |
index 0f80d4a..e08af76 100644
|
|
|
2601b6 |
--- a/coregrind/m_syswrap/syswrap-x86-linux.c
|
|
|
2601b6 |
+++ b/coregrind/m_syswrap/syswrap-x86-linux.c
|
|
|
2601b6 |
@@ -1805,7 +1805,7 @@ static SyscallTableEntry syscall_table[] = {
|
|
|
2601b6 |
LINXY(__NR_name_to_handle_at, sys_name_to_handle_at),// 341
|
|
|
2601b6 |
LINXY(__NR_open_by_handle_at, sys_open_by_handle_at),// 342
|
|
|
2601b6 |
LINXY(__NR_clock_adjtime, sys_clock_adjtime), // 343
|
|
|
2601b6 |
-// LINX_(__NR_syncfs, sys_ni_syscall), // 344
|
|
|
2601b6 |
+ LINX_(__NR_syncfs, sys_syncfs), // 344
|
|
|
2601b6 |
|
|
|
2601b6 |
LINXY(__NR_sendmmsg, sys_sendmmsg), // 345
|
|
|
2601b6 |
// LINX_(__NR_setns, sys_ni_syscall), // 346
|