From 3da9017c17c7d2432c4b76345c4d2efbeedd2935 Mon Sep 17 00:00:00 2001 From: Joey Jiaojg Date: Wed, 26 May 2021 19:38:04 +0800 Subject: pkg/compiler: add glob type * all: add new typename dirname The current way to check files under sysfs or proc is: - define a string to represent each file - open the file - pass the fd to write / read / close The issues above are: - Need to know what file present on target device - Need to write openat for each file With dirname added, which will open one file in the directory randomly and then pass the fd to write/read/close. * all: use typename glob to match filename Fixes #481 --- docs/syscall_descriptions_syntax.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'docs/syscall_descriptions_syntax.md') diff --git a/docs/syscall_descriptions_syntax.md b/docs/syscall_descriptions_syntax.md index 76cdc90b1..4517963eb 100644 --- a/docs/syscall_descriptions_syntax.md +++ b/docs/syscall_descriptions_syntax.md @@ -9,7 +9,7 @@ arg = argname type argname = identifier type = typename [ "[" type-options "]" ] typename = "const" | "intN" | "intptr" | "flags" | "array" | "ptr" | - "string" | "strconst" | "filename" | "len" | + "string" | "strconst" | "filename" | "glob" | "len" | "bytesize" | "bytesizeN" | "bitsize" | "vma" | "proc" type-options = [type-opt ["," type-opt]] ``` @@ -42,6 +42,8 @@ rest of the type-options are type-specific: "stringnoz": a non-zero-terminated memory buffer (no pointer indirection implied), type-options: either a string value in quotes for constant strings (e.g. "foo" or `deadbeef` for hex literal), or a reference to string flags, +"glob": glob pattern to match on target files, type-options: + a zero-terminated glob pattern string in quotes (e.g. "/sys/" or `/sys/**/*` for glob match), "fmt": a string representation of an integer (not zero-terminated), type-options: format (one of "dec", "hex", "oct") and the value (a resource, int, flags, const or proc) the resulting data is always fixed-size (formatted as "%020llu", "0x%016llx" or "%023llo", respectively) -- cgit mrf-deployment