diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/syscall_descriptions_syntax.md | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/docs/syscall_descriptions_syntax.md b/docs/syscall_descriptions_syntax.md index 47986651c..4708dc804 100644 --- a/docs/syscall_descriptions_syntax.md +++ b/docs/syscall_descriptions_syntax.md @@ -185,10 +185,7 @@ type filename string[filename] ## Type Templates -**Note: type templates are experimental, can have error handling bugs and are subject to change** - Type templates can be declared as follows: - ``` type buffer[DIR] ptr[DIR, array[int8]] type fileoff[BASE] BASE @@ -200,11 +197,18 @@ type nlattr[TYPE, PAYLOAD] { ``` and later used as follows: - ``` syscall(a buffer[in], b fileoff[int64], c ptr[in, nlattr[FOO, int32]]) ``` +There is builtin type template `optional` defined as: +``` +type optional[T] [ + val T + void void +] [varlen] +``` + ## Length You can specify length of a particular field in struct or a named argument by using `len`, `bytesize` and `bitsize` types, for example: |
