Skip to content

Commit b445915

Browse files
namanlalitnyulind
andcommitted
Updates to "read_syscall" and "pread_syscall". (#293)
* Added comments for read, pread, _read_chr_file functions * Merge conflicts resolved * Added tests for read_syscall * Added tests for pread_syscall * reverted formatting changes for different file * Addressed review comments * Addressed review comments * Addressed review comments and added comments for a potential bug * Addressed review comments --------- Co-authored-by: lind <lind@nyu.edu>
1 parent 3971d29 commit b445915

File tree

3 files changed

+648
-39
lines changed

3 files changed

+648
-39
lines changed

src/interface/misc.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ pub fn sigcheck() -> bool {
204204
}
205205

206206
pub fn fillrandom(bufptr: *mut u8, count: usize) -> i32 {
207+
// Potential Bug: The fillrandom function is reading from the /dev/urandom
208+
// file, where it should read from "/dev/random" file. And, there should be
209+
// a seperate function for reading from "/dev/random" file.
207210
let slice = unsafe { std::slice::from_raw_parts_mut(bufptr, count) };
208211
let mut f = std::fs::OpenOptions::new()
209212
.read(true)

0 commit comments

Comments
 (0)