We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f9d5e04 commit 11300a5Copy full SHA for 11300a5
1 file changed
docs/日报/2025-4-5.md
@@ -5,6 +5,23 @@
5
1. 为taskext添加文件数量限制,初始化为AX_FILE_LIMIT(1024),和arceos保持一致
6
2. 修改sys_dup当返回的fd大于限制时,close该fd,返回错误码
7
8
+```rust
9
+pub struct TaskExt {
10
+ ......
11
+ /// The limit of fd
12
+ pub fd_limit: AtomicU64,
13
+}
14
+
15
+pub fn sys_dup(old_fd: c_int) -> LinuxResult<isize> {
16
+ // Ok(api::sys_dup(old_fd) as _)
17
+ let new_fd = api::sys_dup(old_fd);
18
+ if new_fd >= current().task_ext().get_fd_limit() as _ {
19
+ return Err(axerrno::LinuxError::EMFILE);
20
+ }
21
+ Ok(new_fd as _)
22
23
+```
24
25

26
27
## 实现sysinfo
0 commit comments