syscall_emul.hh (5748:f28f020f3006) | syscall_emul.hh (5795:72ce7502dc71) |
---|---|
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; --- 523 unchanged lines hidden (view full) --- 532 hostFlags |= O_BINARY; 533#endif 534 535 // Adjust path for current working directory 536 path = process->fullPath(path); 537 538 DPRINTF(SyscallVerbose, "opening file %s\n", path.c_str()); 539 | 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; --- 523 unchanged lines hidden (view full) --- 532 hostFlags |= O_BINARY; 533#endif 534 535 // Adjust path for current working directory 536 path = process->fullPath(path); 537 538 DPRINTF(SyscallVerbose, "opening file %s\n", path.c_str()); 539 |
540 // open the file 541 int fd = open(path.c_str(), hostFlags, mode); | 540 int fd; 541 if (!path.compare(0, 6, "/proc/") || !path.compare(0, 8, "/system/") || 542 !path.compare(0, 10, "/platform/") || !path.compare(0, 5, "/sys/")) { 543 // It's a proc/sys entery and requires special handling 544 fd = OS::openSpecialFile(path, process, tc); 545 return (fd == -1) ? -1 : process->alloc_fd(fd,path.c_str(),hostFlags,mode, false); 546 } else { 547 // open the file 548 fd = open(path.c_str(), hostFlags, mode); 549 return (fd == -1) ? -errno : process->alloc_fd(fd,path.c_str(),hostFlags,mode, false); 550 } |
542 | 551 |
543 return (fd == -1) ? -errno : process->alloc_fd(fd,path.c_str(),hostFlags,mode, false); | |
544} 545 546 547/// Target chmod() handler. 548template <class OS> 549SyscallReturn 550chmodFunc(SyscallDesc *desc, int callnum, LiveProcess *process, 551 ThreadContext *tc) --- 494 unchanged lines hidden --- | 552} 553 554 555/// Target chmod() handler. 556template <class OS> 557SyscallReturn 558chmodFunc(SyscallDesc *desc, int callnum, LiveProcess *process, 559 ThreadContext *tc) --- 494 unchanged lines hidden --- |