Syscall: Don't close the simulator's standard file descriptors.
Review Request #52 - Created July 9, 2010 and submitted
Information | |
---|---|
Timothy Jones | |
gem5 | |
Reviewers | |
Default | |
Syscall: Don't close the simulator's standard file descriptors.
Posted (July 11, 2010, 8:25 a.m.)
-
src/sim/syscall_emul.cc (Diff revision 1) -
I personally feel that the use of ?: here isn't warranted. It hides what this line of code is actually doing. Much better IMHO to do this even though it is more verbose: int status = 0; if (sim_fd > 2) status = close(sim_fd);
Review request changed
Updated (July 16, 2010, 6:24 a.m.)
Diff: |
Revision 2 (+4 -1) |
---|
Posted (July 16, 2010, 7:09 a.m.)
-
src/sim/syscall_emul.cc (Diff revision 2) -
this should be: status = close(sim_fd);
Review request changed
Updated (July 16, 2010, 10:57 a.m.)
Diff: |
Revision 3 (+4 -1) |
---|
Posted (July 21, 2010, 5:21 p.m.)
-
src/sim/syscall_emul.cc (Diff revision 3) -
We might want a more robust way of detecting whether a file descriptor is safe to close. This will catch instances where stdout, stderr and stdin are forwarded to the simulated program, but could there be others? I can't think of any off hand, but we should at least think about it carefully. This shouldn't prevent you from checking this in, though, since some allegedly imperfect protection is better than no protection.