summaryrefslogtreecommitdiff
path: root/src/sim/syscall_emul.hh
diff options
context:
space:
mode:
authorSteve Reinhardt <steve.reinhardt@amd.com>2012-08-06 16:52:49 -0700
committerSteve Reinhardt <steve.reinhardt@amd.com>2012-08-06 16:52:49 -0700
commitb647b48bf4d980e26b4626e94f1207ad66fc324e (patch)
tree552ff31c06305500cde480a456a152d94f9e1293 /src/sim/syscall_emul.hh
parentd55115936e0711422c6d708572b391e15432bec1 (diff)
downloadgem5-b647b48bf4d980e26b4626e94f1207ad66fc324e.tar.xz
str: add an overloaded startswith() utility method
for various string types and use it in a few places.
Diffstat (limited to 'src/sim/syscall_emul.hh')
-rw-r--r--src/sim/syscall_emul.hh4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh
index 0627d8d91..b2786e572 100644
--- a/src/sim/syscall_emul.hh
+++ b/src/sim/syscall_emul.hh
@@ -640,8 +640,8 @@ openFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
DPRINTF(SyscallVerbose, "opening file %s\n", path.c_str());
int fd;
- if (!path.compare(0, 6, "/proc/") || !path.compare(0, 8, "/system/") ||
- !path.compare(0, 10, "/platform/") || !path.compare(0, 5, "/sys/")) {
+ if (startswith(path, "/proc/") || startswith(path, "/system/") ||
+ startswith(path, "/platform/") || startswith(path, "/sys/")) {
// It's a proc/sys entery and requires special handling
fd = OS::openSpecialFile(path, process, tc);
return (fd == -1) ? -1 : process->alloc_fd(fd,path.c_str(),hostFlags,mode, false);