projects
/
gem5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5f42bfc
)
syscall: Fix TTY emulation in fstat() user-mode simulation for fd 1 (stdout).
author
Michael Adler
<Michael.Adler@intel.com>
Thu, 24 Jul 2008 23:31:33 +0000
(16:31 -0700)
committer
Michael Adler
<Michael.Adler@intel.com>
Thu, 24 Jul 2008 23:31:33 +0000
(16:31 -0700)
The code didn't set S_IFCHR in the st_mode
src/sim/syscall_emul.hh
patch
|
blob
|
history
diff --git
a/src/sim/syscall_emul.hh
b/src/sim/syscall_emul.hh
index 6dafee34c9f65dd96c022b02fc4931b9ef6ebd7e..caf2699183096e2c8fa118071ada9b52e0a09401 100644
(file)
--- a/
src/sim/syscall_emul.hh
+++ b/
src/sim/syscall_emul.hh
@@
-380,6
+380,11
@@
convertStatBuf(target_stat &tgt, host_stat *host, bool fakeTTY = false)
tgt->st_ino = host->st_ino;
tgt->st_ino = htog(tgt->st_ino);
tgt->st_mode = host->st_mode;
+ if (fakeTTY) {
+ // Claim to be a character device
+ tgt->st_mode &= ~S_IFMT; // Clear S_IFMT
+ tgt->st_mode |= S_IFCHR; // Set S_IFCHR
+ }
tgt->st_mode = htog(tgt->st_mode);
tgt->st_nlink = host->st_nlink;
tgt->st_nlink = htog(tgt->st_nlink);