Skip to content

Commit 3764361

Browse files
committed
Addressed review comments
1 parent 5cfca3d commit 3764361

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/safeposix/syscalls/fs_calls.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,6 +1493,7 @@ impl Cage {
14931493
// For `Socket` type inode, a panic is returned as socket type files are not
14941494
// supported.
14951495
Inode::Socket(_) => {
1496+
// Read is not supported for Socket type inodes.
14961497
panic!("read(): Socket inode found on a filedesc fd.")
14971498
}
14981499

@@ -1741,13 +1742,14 @@ impl Cage {
17411742

17421743
/// ### Description
17431744
///
1744-
/// The `_read_chr_file()` helper function reads from character devices by
1745-
/// matching the device number (DevNo) of the DeviceInode. It handles
1746-
/// `/dev/null`, `/dev/zero`, `/dev/random`, and `/dev/urandom` by
1747-
/// performing the appropriate actions for each device. If the device is
1748-
/// unsupported, it returns an error indicating that the operation is
1749-
/// not supported. This function is used for interacting with special
1750-
/// character files in a Unix-like filesystem.
1745+
/// The `_read_chr_file()` helper function is used by `read_syscall()` and
1746+
/// `pread_syscall()` for reading from character device type files.
1747+
/// It reads from character devices by matching the device number (DevNo)
1748+
/// of the DeviceInode. It handles `/dev/null`, `/dev/zero`, `/dev/random`,
1749+
/// and `/dev/urandom` by performing the appropriate actions for each
1750+
/// device. If the device is unsupported, it returns an error indicating
1751+
/// that the operation is not supported. This function is used for
1752+
/// interacting with special character files in a Unix-like filesystem.
17511753
///
17521754
/// ### Function Arguments
17531755
///

0 commit comments

Comments
 (0)