syscall_emul: Corrected a bug on the syscall "read()" when reading EOF
Review Request #3582 - Created July 23, 2016 and submitted
| Information | |
|---|---|
| Nicolas Derumigny | |
| gem5 | |
| Reviewers | |
| Default | |
syscall_emul: Corrected a bug on the syscall "read()".
Read() should not write anything when returning 0 (EOF).
This patch does not correct the same bug occuring for :nbr_read=read(file, buf, nbytes)
When nbr_read<nbytes, nbytes bytes are copied into the virtual
RAM instead of nbr_read. If buf is smaller than nbytes, a
page fault occurs, even if buf is in fact bigger than nbr_read.
Works with CERE codelets (https://github.com/benchmark-subsetting/cere),
correcting the issue when replacing dumps in memory.
LGTM, could you make sure that your description follows the fomatting guidelines (e.g., 65 char for the short description and 75 char per line in the long description). This makes it much easier for us to commit your patch :).
Description: |
|
|---|
Testing Done: |
|
|---|
Ship It!
Ship It!
Thanks for the bug fix!
Note that the tag for the commit message is 'syscall_emul', not "syscall_emu'.
-
src/sim/syscall_emul.cc (Diff revision 1) -
I would drop this comment. It makes sense in the context of this patch (and is appropriate for the commit message), but it is confusing when you don't know what the code used to look like. The fact that there used to be a bug here is irrelevant to people who look at this code in the future.
Change Summary:
Suppressed useless comment.
Summary: |
|
||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: |
|
||||||||||||||||||||||||||||||
Diff: |
Revision 2 (+1 -1) |
Please mark this as submitted. Thanks.
