summaryrefslogtreecommitdiffstats
path: root/tapset
diff options
context:
space:
mode:
Diffstat (limited to 'tapset')
-rw-r--r--tapset/string.stp12
-rw-r--r--tapset/syscalls.stp8
2 files changed, 16 insertions, 4 deletions
diff --git a/tapset/string.stp b/tapset/string.stp
index 2f43aecc..35ee9fa2 100644
--- a/tapset/string.stp
+++ b/tapset/string.stp
@@ -25,6 +25,18 @@ function substr:string(str:string,start:long, length:long) %{ /* pure */
strlcpy(THIS->__retvalue, THIS->str + THIS->start, length);
%}
+/** @addtogroup library
+* @code function stringat:string(str:string, pos:long) @endcode
+* @param str string
+* @param pos the given position. 0 = start of the string
+* @return Returns the char in given position of string.
+*/
+function stringat:long(str:string, pos:long) %{ /* pure */
+ if (THIS->pos >= 0 && THIS->pos < strlen(THIS->str))
+ THIS->__retvalue = THIS->str[THIS->pos];
+ else
+ THIS->__retvalue = 0;
+%}
/** @addtogroup library
* @code isinstr:long(s1:string,s2:string) @endcode
diff --git a/tapset/syscalls.stp b/tapset/syscalls.stp
index 256174d3..a215dc12 100644
--- a/tapset/syscalls.stp
+++ b/tapset/syscalls.stp
@@ -733,7 +733,7 @@ probe syscall.faccessat.return = kernel.function("SyS_faccessat").return !,
probe syscall.fadvise64 = kernel.function("SyS_fadvise64") !,
kernel.function("sys_fadvise64") ? {
name = "fadvise64"
- fs = $fd
+ fd = $fd
offset = $offset
len = $len
advice = $advice
@@ -751,7 +751,7 @@ probe syscall.fadvise64.return = kernel.function("SyS_fadvise64").return !,
probe syscall.fadvise64_64 = kernel.function("SyS_fadvise64_64") !,
kernel.function("sys_fadvise64_64") ? {
name = "fadvise64_64"
- fs = $fd
+ fd = $fd
offset = $offset
len = $len
advice = $advice
@@ -771,7 +771,7 @@ probe syscall.fadvise64_64.return = kernel.function("SyS_fadvise64_64").return !
probe syscall.fadvise64 = kernel.function("SyS_fadvise64") !,
kernel.function("sys_fadvise64") {
name = "fadvise64"
- fs = 0
+ fd = 0
offset = 0
len = 0
advice = 0
@@ -789,7 +789,7 @@ probe syscall.fadvise64.return = kernel.function("SyS_fadvise64").return !,
probe syscall.fadvise64_64 = kernel.function("SyS_fadvise64_64") !,
kernel.function("sys_fadvise64_64") {
name = "fadvise64_64"
- fs = 0
+ fd = 0
offset = 0
len = 0
advice = 0