From 620e744b5dacfc2338fd2bdb56e3970f1c01f825 Mon Sep 17 00:00:00 2001 From: mohanson Date: Mon, 6 May 2024 14:48:42 +0800 Subject: [PATCH] Optimize ckb_close --- rfcs/0050-vm-syscalls-3/0050-vm-syscalls-3.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rfcs/0050-vm-syscalls-3/0050-vm-syscalls-3.md b/rfcs/0050-vm-syscalls-3/0050-vm-syscalls-3.md index d8680eaa..073870ec 100644 --- a/rfcs/0050-vm-syscalls-3/0050-vm-syscalls-3.md +++ b/rfcs/0050-vm-syscalls-3/0050-vm-syscalls-3.md @@ -127,7 +127,7 @@ When using `ckb_read` and `ckb_write`, there may be the following scenarios: ### Close [Close]: #close -This syscall manually closes a file descriptor. After calling this, any attempt to read/write the file descriptor pointed to the other end would fail. After using close, there are four typical situations: +This syscall manually closes a file descriptor. After calling this, any attempt to read/write the file descriptor pointed to the other end would fail, so closing a single file descriptor, essentially closes the entire pair of pipes. After using close, there are four typical situations: - close writer, and then try to write data to writer through `ckb_write`. In this case `ckb_write` will fail and return error(6). - close writer, and then try to read data from reader through `ckb_read`. In this case if there is unread data in Pipe, ckb_read will execute normally; otherwise, it will return error(7).