| 1 |
# ftruncate64 _________________________________________________ |
| 2 |
# |
| 3 |
# COMPAT_SYSCALL_DEFINE3(s390_ftruncate64, unsigned int, fd, u32, high, |
| 4 |
# u32, low) |
| 5 |
# |
| 6 |
|
| 7 |
@define _SYSCALL_COMPAT_FTRUNCATE64_NAME |
| 8 |
%( |
| 9 |
name = "ftruncate" |
| 10 |
%) |
| 11 |
|
| 12 |
@define _SYSCALL_COMPAT_FTRUNCATE64_ARGSTR |
| 13 |
%( |
| 14 |
argstr = sprintf("%d, %d", fd, length) |
| 15 |
%) |
| 16 |
|
| 17 |
probe syscall.compat_ftruncate64 = dw_syscall.compat_ftruncate64 !, |
| 18 |
nd_syscall.compat_ftruncate64 ? {} |
| 19 |
probe syscall.compat_ftruncate64.return = dw_syscall.compat_ftruncate64.return !, |
| 20 |
nd_syscall.compat_ftruncate64.return ? {} |
| 21 |
|
| 22 |
# dw_compat_ftruncate64 _____________________________________________________ |
| 23 |
|
| 24 |
probe dw_syscall.compat_ftruncate64 = |
| 25 |
kernel.function("sys32_ftruncate64").call ?, |
| 26 |
kernel.function("compat_sys_s390_ftruncate64").call ? |
| 27 |
{ |
| 28 |
@_SYSCALL_COMPAT_FTRUNCATE64_NAME |
| 29 |
fd = __int32($fd) |
| 30 |
length = (($high << 32) | __uint32($low)) |
| 31 |
@_SYSCALL_COMPAT_FTRUNCATE64_ARGSTR |
| 32 |
} |
| 33 |
probe dw_syscall.compat_ftruncate64.return = |
| 34 |
kernel.function("sys32_ftruncate64").return ?, |
| 35 |
kernel.function("compat_sys_s390_ftruncate64").return ? |
| 36 |
{ |
| 37 |
@_SYSCALL_COMPAT_FTRUNCATE64_NAME |
| 38 |
@SYSC_RETVALSTR($return) |
| 39 |
} |
| 40 |
|
| 41 |
# nd_compat_ftruncate64 _____________________________________________________ |
| 42 |
|
| 43 |
probe nd_syscall.compat_ftruncate64 = kprobe.function("sys32_ftruncate64") ?, |
| 44 |
kprobe.function("compat_sys_s390_ftruncate64") ? |
| 45 |
{ |
| 46 |
asmlinkage() |
| 47 |
@_SYSCALL_COMPAT_FTRUNCATE64_NAME |
| 48 |
fd = int_arg(1) |
| 49 |
length = ((uint_arg(2) << 32) | uint_arg(3)) |
| 50 |
@_SYSCALL_COMPAT_FTRUNCATE64_ARGSTR |
| 51 |
} |
| 52 |
probe nd_syscall.compat_ftruncate64.return = |
| 53 |
kprobe.function("sys32_ftruncate64").return ?, |
| 54 |
kprobe.function("compat_sys_s390_ftruncate64").return ? |
| 55 |
{ |
| 56 |
@_SYSCALL_COMPAT_FTRUNCATE64_NAME |
| 57 |
@SYSC_RETVALSTR(returnval()) |
| 58 |
} |