syscall_emul.hh (9141:593fe25c86a6) syscall_emul.hh (9142:e9b713df4e1d)
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 626 unchanged lines hidden (view full) ---

635#endif
636
637 // Adjust path for current working directory
638 path = process->fullPath(path);
639
640 DPRINTF(SyscallVerbose, "opening file %s\n", path.c_str());
641
642 int fd;
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 626 unchanged lines hidden (view full) ---

635#endif
636
637 // Adjust path for current working directory
638 path = process->fullPath(path);
639
640 DPRINTF(SyscallVerbose, "opening file %s\n", path.c_str());
641
642 int fd;
643 if (!path.compare(0, 6, "/proc/") || !path.compare(0, 8, "/system/") ||
644 !path.compare(0, 10, "/platform/") || !path.compare(0, 5, "/sys/")) {
643 if (startswith(path, "/proc/") || startswith(path, "/system/") ||
644 startswith(path, "/platform/") || startswith(path, "/sys/")) {
645 // It's a proc/sys entery and requires special handling
646 fd = OS::openSpecialFile(path, process, tc);
647 return (fd == -1) ? -1 : process->alloc_fd(fd,path.c_str(),hostFlags,mode, false);
648 } else {
649 // open the file
650 fd = open(path.c_str(), hostFlags, mode);
651 return (fd == -1) ? -errno : process->alloc_fd(fd,path.c_str(),hostFlags,mode, false);
652 }

--- 689 unchanged lines hidden ---
645 // It's a proc/sys entery and requires special handling
646 fd = OS::openSpecialFile(path, process, tc);
647 return (fd == -1) ? -1 : process->alloc_fd(fd,path.c_str(),hostFlags,mode, false);
648 } else {
649 // open the file
650 fd = open(path.c_str(), hostFlags, mode);
651 return (fd == -1) ? -errno : process->alloc_fd(fd,path.c_str(),hostFlags,mode, false);
652 }

--- 689 unchanged lines hidden ---