From b749e1dcdeba2e670008173f2733dbb8efd7523e Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Thu, 15 Jun 2023 11:54:34 +0200 Subject: demo: Add read.hjson example Signed-off-by: Stefano Brivio --- demo/read.hjson | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 demo/read.hjson (limited to 'demo') diff --git a/demo/read.hjson b/demo/read.hjson new file mode 100644 index 0000000..071ce3a --- /dev/null +++ b/demo/read.hjson @@ -0,0 +1,13 @@ +[ + { + "match": [ + { "read": { "path": "/tmp/abcd2", "buf": { "tag": "buf" }, "count": { "tag": "count" } } } + ], + "call": [ + { "open": { "path": "/tmp/abcd", "flags": "rdonly", "mode": 0 }, "ret": "new_fd" }, + { "read": { "fd": { "tag": { "get": "new_fd" } }, "buf": { "tag": { "set": "new" } }, "count": { "tag": { "get": "count" } } }, "ret": "n" } + ], + "write": { "src": "new", "dst": "buf", "count": "n" }, + "return": { "value": { "tag": "n" } } + } +] -- cgit v1.2.3